-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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: pub use
for macros is inlined too eagerly
#50647
Comments
Looks like this affects beta as well - https://doc.rust-lang.org/beta/std/#reexports |
cc @rust-lang/rustdoc |
Ah, indeed. I'll take a look as soon as possible. |
@GuillaumeGomez what's the status on this? |
Still on my todo list. |
Some initial poking: Re-exported macros are currently pulled in during rust/src/librustdoc/visit_ast.rs Lines 219 to 252 in 1962a70
The actual export statement is handled in rust/src/librustdoc/visit_ast.rs Lines 409 to 443 in 1962a70
Notably, this means that any A "quick fix" for this would be to check the import statement for |
While finishing that comment, i realized that cross-crate inlining happens in |
The problem with moving the macro handling code to rust/src/librustc_resolve/resolve_imports.rs Lines 916 to 921 in 1962a70
If it wasn't for |
I'm confused. Does |
… r=ollie27 rustdoc: hide macro export statements from docs As mentioned in rust-lang#50647, rustdoc now prints both the import statement and the macro itself when re-exporting macros. This is a stopgap solution to clean up the std docs and get something small backported into beta. What this does: When rustdoc finds an export statement for a macro, instead of printing the export and bailing, now it will instead hide the export and bail. Until we can solve rust-lang#34843 or have a better way to find the attributes on an export statement when inlining macros, this will at least match the current behavior and clean up the re-export statements from the docs.
rustdoc: import cross-crate macros alongside everything else The thrilling conclusion of the cross-crate macro saga in rustdoc! After #51425 made sure we saw all the namespaces of an import (and prevented us from losing the `vec!` macro in std's documentation), here is the PR to handle cross-crate macro re-exports at the same time as everything else. This way, attributes like `#[doc(hidden)]` and `#[doc(no_inline)]` can be used to control how the documentation for these macros is seen, rather than rustdoc inlining every macro every time. Fixes #50647
pub use
for macros is "inlined" (in rustdoc sense) too eagerly and may show duplicated documentation (both inlined and non-inlined) and ignore#[doc(no_inline)]
and apparently#[doc(hidden)]
(#35896 (comment)) as well.This can now be observed on nightly docs for the standard library - https://doc.rust-lang.org/nightly/std/.
The "Re-exports" section wasn't there previously and everything was in inlined-only form.
The text was updated successfully, but these errors were encountered: