Skip to content

#[doc = $expr] in macro silently fails to generate docs #44730

Closed
@Manishearth

Description

@Manishearth
#![warn(missing_docs)]

//! la la la

macro_rules! make_enum {
    ($(($name:ident, $string:expr)),+) => {
        /// la la la
        pub enum Foo {
            $(
                #[doc = $string]
                $name,
            )+
        }
    }
}

make_enum!{(A, "a"), (B, "b"), (C, "c")}

This will not generate docs for the generated enum, and will warn about missing docs on the enum variant. (missing_docs is off by default, so normally you wouldn't notice this)

This is a rustc bug, not a rustdoc bug, since the lint fails too (so we're somehow losing the doc attribute entirely). This works fine on beta.

cc @eddyb

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions