New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments for macro expansions #37277
Comments
You could just forward all attributes (doc comments are Example (playground) macro_rules! foo_macro {
($(#[$attr:meta])* struct $name:ident) => {
$(#[$attr])*
pub struct $name;
}
}
foo_macro!(
/// Doc comment for Foo struct.
struct Foo
);
foo_macro!(
/// Doc comment for Bar struct.
struct Bar
);
fn main() {
} The user forum is a good place to discuss questions like this. https://users.rust-lang.org/ |
Concrete bug reports are very welcome here, but I'll close this as it has been answered and futher discussion is best on the user forum. |
The issue here does not seem to be solved. How to write doc comments for macros that start with an |
In this trivial code sample the user wants to create a struct via macro expansion and write a unique comment for every different macro invokation.
This means a unique comment for struct Foo and Bar which is currently not possible in the rust compiler when enabling:
#![warn(missing_docs)]
With the following warnings:
While this obviously does work:
The text was updated successfully, but these errors were encountered: