-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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: Preprocess intra-doc links consistently between crate loader and link resolver #84066
Conversation
This comment has been minimized.
This comment has been minimized.
Line 1072 also needs to be part of the function or it will panic on that too:
|
This comment has been minimized.
This comment has been minimized.
d6d3a46
to
27799b3
Compare
Ok, this should be ready for review. |
030b4b3
to
e3bd08a
Compare
Previously, rustdoc would panic on links to external crates if they were surrounded by backticks.
e3bd08a
to
47d1ed9
Compare
@bors r+ |
📌 Commit 47d1ed9 has been approved by |
@@ -892,6 +892,117 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> { | |||
} | |||
} | |||
|
|||
crate enum PreprocessingError<'a> { | |||
Anchor(AnchorFailure), | |||
Disambiguator(Range<usize>, String), |
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.
nit: worth having comments on each one explaining what the error is
rustdoc: Move crate loader to collect_intra_doc_links::early This groups the similar code together, and also allows making most of collect_intra_doc_links private again. This builds on rust-lang#84066, but it wouldn't be too hard to base it off master if you want this to land first. Helps with rust-lang#83761. r? manishearth Fixes rust-lang#84046
Hmm, somehow this PR still got merged after being |
Ah, that makes sense. |
Previously, rustdoc would panic on links to external crates if they were
surrounded by backticks or the first path segment contained generics.
This is more extensive than the fix I suggested in #84046; it makes the preprocessing exactly the same rather than trying to duplicate only the necessary logic. This makes fixing the generics a lot easier as it turns out.
Fixes #84046.
r? @Manishearth