Closed
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) => { ... };
}
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
dtolnay commentedon Apr 14, 2019
Same behavior as of rustc 1.35.0-nightly (e4c66af 2019-04-13).
Small doc fixup to workaround rustdoc bug
jyn514 commentedon Dec 16, 2020
Same behavior as of rustdoc 1.50.0-nightly (0f6f2d6 2020-12-06).
dtolnay commentedon Dec 26, 2021
Fixed in nightly-2021-07-06, likely by #86282.
jyn514 commentedon Dec 27, 2021
Oh wow, look at that! Congrats @camelid :)