-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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: Resolve doc links referring to macro_rules
items
#96521
Conversation
r? @notriddle (rust-highfive has picked a reviewer for you, use r? to override) |
This comment was marked as resolved.
This comment was marked as resolved.
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.
Overall, I like this change. Using the "real" name resolver, instead of dumping all the macro_rules
into a big global hash map, is definitely a bug fix. The rustdoc name resolver should act like the regular one as much as is reasonable.
But (1) this is a breaking change, and (2) even though I was assigned to it, I'm still not really the best expert on this kind of change.
@@ -640,6 +640,8 @@ macro_rules! unreachable { | |||
/// | |||
/// Like `panic!`, this macro has a second form for displaying custom values. | |||
/// | |||
/// [`todo!`]: crate::todo |
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.
Changes like this imply the need for a Crater run and rel-notes tag. Right?
Only removal of the |
That sounds great. I actually do want to land this change. It's just that we know there's going to be breakage, and we know docs.rs doesn't make warnings very visible, so anyone publishing there might not even notice. |
Then crater won't catch them either? |
That's a good point. 😐 Is there any clear way to identify or mitigate the breakage here? I'd like to use a backcompat warning, but anyone using docs.rs won't actually see it. I thought maybe a crater run could be made with Maybe a crater run with a tweaked version that, instead of making the fallback fill in a resolution, the "fallback" is tweaked to produce a hard error whenever it actually runs and resolves something? |
Ok, that should be possible.
|
This way links referring to `macro_rules` items are resolved correctly
Updated the PR, removal of the |
So unless I missed something, we need a crater run here, right? |
No, crater run is no longer needed. |
Then let's go. Thanks! @bors: r=notriddle,GuillaumeGomez |
📌 Commit 6083db7 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (4dd8b42): comparison url. Summary: This benchmark run did not return any relevant results. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
rustdoc: Remove doc link resolution fallback to all `macro_rules` in the crate This is a deny-by-default lint detecting such fallback for crater run, as discussed in rust-lang#96521.
cc #81633
UPD: the fallback to considering all
macro_rules
in the crate for unresolved names is not removed in this PR, it will be removed separately and will be run through crater.