Skip to content
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

Rustdoc can generate wrong macro_rules! syntax #60543

Closed
jonas-schievink opened this issue May 4, 2019 · 2 comments
Closed

Rustdoc can generate wrong macro_rules! syntax #60543

jonas-schievink opened this issue May 4, 2019 · 2 comments
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jonas-schievink
Copy link
Contributor

jonas-schievink commented May 4, 2019

Example: https://docs.rs/pkg-version/0.1.0/pkg_version/macro.pkg_version_minor.html

The source code looks like this:

#[proc_macro_hack]
pub use pkg_version_impl::pkg_version_minor;

The rustdoc output looks like this:

macro_rules! pkg_version_minor {
    #[proc_macro_hack] => { ... };
}

Now I'm not entirely sure how #[proc_macro_hack] works, but I don't think rustdoc should ever produce... this? The matcher is syntactically invalid, so this should never really happen.

Perhaps related to #45939, but I'm not sure.

@jonas-schievink jonas-schievink added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-bug Category: This is a bug. labels May 4, 2019
@dtolnay
Copy link
Member

dtolnay commented Dec 26, 2021

Fixed in nightly-2021-07-06, likely by #86282.

@dtolnay dtolnay closed this as completed Dec 26, 2021
@dtolnay
Copy link
Member

dtolnay commented Dec 26, 2021

The new rustdoc shows:

macro_rules! pkg_version_minor {
    ($($proc_macro : tt) *) => { ... };
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants