rustdoc: import cross-crate macros alongside everything else#51611
rustdoc: import cross-crate macros alongside everything else#51611bors merged 5 commits intorust-lang:masterfrom
Conversation
|
r? @frewsxcv (rust_highfive has picked a reviewer for you, use r? to override) |
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
hey look, macros properly link to the right place now
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
src/librustdoc/clean/inline.rs
Outdated
| }; | ||
|
|
||
| let source = format!("macro_rules! {} {{\n{}}}", | ||
| def.ident.name.clean(cx), |
There was a problem hiding this comment.
This needs to use the name passed to try_inline so that things like pub use foo::foo_macro as bar_macro; will display bar_macro here.
There was a problem hiding this comment.
I wonder if this is something we need to do for other imports. None of them are using the imported name either, and IIRC we have other issues regarding imported structs using the wrong name in impl pages.
There was a problem hiding this comment.
I believe that's a different issue. The difference with macros is that the definition is being rendered here rather than in render.rs like all other item types.
|
r? @ollie27 (also, review ping!) |
|
r=me with a test for the renamed case. |
|
@ollie27 Sorry for the delay; I've pushed a commit which updates the test. |
|
@bors: r+ |
|
📌 Commit 61dc03c has been approved by |
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
|
☀️ Test successful - status-appveyor, status-travis |
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