-
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
Support proc macros in intra doc link resolution #73183
Conversation
r? @ollie27 (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 |
6acf5dc
to
e003c3e
Compare
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 |
Neat bug, pushing a fix now. Interestingly, I tried adding support for stuff like |
@@ -532,6 +585,9 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> { | |||
} else if link.starts_with("macro@") { | |||
kind = Some(MacroNS); | |||
link.trim_start_matches("macro@") | |||
} else if link.starts_with("derive@") { |
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'm wondering: is there any reason behind supporting derive@
too? (Not against it, just curious)
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.
People don't typically consider custom derives to be macros, so asking them to use macro@
seems weird. macro@
still will work (this is true of all of the disambiguators, they don't do anything other than selecting the namespace)
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.
Looks good. Just some tests missing and we're good to go!
@bors r=GuillaumeGomez |
📌 Commit 34c6b38 has been approved by |
🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened |
Rollup of 11 pull requests Successful merges: - rust-lang#72380 (Fix `is_const_context`, update `check_for_cast`) - rust-lang#72941 (Ensure stack when building MIR for matches) - rust-lang#72976 (Clean up E0642 explanation) - rust-lang#73080 (doc/rustdoc: Fix incorrect external_doc feature flag) - rust-lang#73155 (save_analysis: better handle paths and functions signature) - rust-lang#73164 (Add new E0762 error code) - rust-lang#73172 (Fix more clippy warnings) - rust-lang#73181 (Automatically prioritize unsoundness issues) - rust-lang#73183 (Support proc macros in intra doc link resolution) - rust-lang#73208 (Fix doctest template) - rust-lang#73219 (x.py: with --json-output, forward cargo's JSON) Failed merges: r? @ghost
The feature was written pre-proc macro resolution, so it only supported the wacky MBE resolution rules. This adds support for proc macros as well.
cc @GuillaumeGomez
Fixes #73173