-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
As part of dtolnay/syn#225 I am generating one macro_rules! macro from another macro_rules! macro. Everything works great except that the documentation of the generated macro is misleading.
Simplified example:
macro_rules! outer {
($(($n:ident $kw:ident))*) => {
$(
#[derive(Debug)]
pub struct $n;
)*
#[macro_export]
macro_rules! inner {
$(
($kw) => { $n };
)*
}
}
}
outer! {
(Let let)
(Loop loop)
(Match match)
(Mod mod)
}
fn main() {
println!("{:?}", inner!(loop));
}
Rustdoc shows the following:
macro_rules! inner {
($kw) => { ... };
($kw) => { ... };
($kw) => { ... };
($kw) => { ... };
}
Instead I would expect:
macro_rules! inner {
(let) => { ... };
(loop) => { ... };
(match) => { ... };
(mod) => { ... };
}
ogoffart
Metadata
Metadata
Assignees
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.