Skip to content

rustdoc: Bad handling of proc_macro's re-exported via use_extern_macros #49553

Closed

Description

@Nemo157

If you define a proc-macro in one crate, then re-export it from another crate via the use_extern_macros feature the resulting documentation does not link to the macro correctly, and the tooltip has some weird details displayed in it:

link: ../proc_macro_re_export_proc_macro/macro.%7B%7BGlobalMetaData::Krate%7D%7D.html

screen shot 2018-04-01 at 11 27 56 am

Activity

  1. added
    C-enhancementCategory: An issue proposing an enhancement or a PR with one.
    A-diagnosticsArea: Messages for errors, warnings, and lints
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    A-decl-macros-2-0Area: Declarative macros 2.0 (#39412)
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    and removed
    A-diagnosticsArea: Messages for errors, warnings, and lints
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Apr 12, 2018
  2. QuietMisdreavus commented on Aug 23, 2018

    @QuietMisdreavus
    Contributor

    Still broken, looks like. Seems we'll need to properly document proc-macros, and handle their re-export, now.

    Something that strikes me as odd is that the original crate shows the proc-macro as a function, and it's only when it's re-exported is it seen as a macro:

    image

    I think we'll need to handle the #[proc_macro_attribute] (and other proc-macro declaration attributes) when displaying these items. Then we'll need to see what happens when we get these as re-exports. I'm not too surprised that it still appears as a re-export, but i am curious what is causing it to mess up the link like that.

  3. QuietMisdreavus commented on Sep 24, 2018

    @QuietMisdreavus
    Contributor

    Update: It looks like the odd curly-brace segment of the link is gone, but the links are still broken because rustdoc is still treating proc-macros as functions in their source crate. Not sure what fixed that, but it means one less thing to figure out when fixing this for real.

  4. QuietMisdreavus commented on Sep 25, 2018

    @QuietMisdreavus
    Contributor

    I've opened #54577 to make rustdoc properly document proc-macros, but there's a wrinkle that means their re-export is still a little awkward (though it's better than before). I wrote more about it in that PR.

  5. added a commit that references this issue on Sep 29, 2018
  6. 3 remaining items

  7. added 2 commits that reference this issue on Aug 24, 2019
    3733450
    1a89e16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-decl-macros-1-2Area: Declarative macros 1.2A-decl-macros-2-0Area: Declarative macros 2.0 (#39412)C-enhancementCategory: An issue proposing an enhancement or a PR with one.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