-
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: resolve intra-doc links when checking HTML #93605
rustdoc: resolve intra-doc links when checking HTML #93605
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
634d879
to
e0d4279
Compare
e0d4279
to
6821010
Compare
This comment has been minimized.
This comment has been minimized.
6821010
to
1d23c7c
Compare
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.
Now it looks good to me! 👍
|
||
let mut replacer = |broken_link: BrokenLink<'_>| { | ||
if let Some(link) = | ||
link_names.iter().find(|link| *link.original_text == *broken_link.reference) |
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 seems like it might be kind of slow... maybe worth addressing in the future (not in this PR).
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.
We will run a perf check just to be sure the impact isn't too big, otherwise it'll have to be fixed in this PR (good catch!).
Am I correct in thinking that this change just improves lint warnings and does not add new syntax? Also, could you post what the errors looked like before this change? Thanks. Other than that, I have no objections. I haven't reviewed the code in detail though. |
r? @GuillaumeGomez |
That’s the idea, yes. This way, when you use generics with intra-doc links, you don’t get spurious warnings about unclosed tags. |
@notriddle Can you show examples please? |
Given the following test case: #![warn(rustdoc::invalid_html_tags)]
#![warn(rustdoc::broken_intra_doc_links)]
pub struct ExistentStruct<T>(T);
/// This [test][ExistentStruct<i32>] thing!
pub struct NoError; This pull request silences the following, spurious warning:
|
Thanks for the explanations! Let's run a perf check and see if we need to work on perf before merging. @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 7fe679c29f8b64dc2a00a719989c5e3e747bf0b3 with merge 3a112530c438a994fa3c69af84a30ebf311b95c4... |
Finished benchmarking commit (3a112530c438a994fa3c69af84a30ebf311b95c4): comparison url. Summary: This benchmark run did not return any relevant results. 10 results were found to be statistically significant but too small to be relevant. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. @bors rollup=never |
Perfect! Let's move forward then. Thanks! @bors: r+ |
📌 Commit 7fe679c29f8b64dc2a00a719989c5e3e747bf0b3 has been approved by |
7fe679c
to
1a6d41c
Compare
@bors r=GuillaumeGomez Squashed the nit-fix commit in. |
📌 Commit 1a6d41c has been approved by |
⌛ Testing commit 1a6d41c with merge 8d51c58456739df3bc9036f185d720d0efb5ccba... |
💔 Test failed - checks-actions |
@bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (6d7aa47): 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 |
Similar to #86451
CC #67799
Given this test case:
This pull request silences the following, spurious warning: