-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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: import cross-crate macros alongside everything else #51611
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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