Skip to content

Rustdoc can generate wrong macro_rules! syntax #60543

Closed
@jonas-schievink

Description

@jonas-schievink

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions