-
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: refactor how passes are structured, and turn intra-doc-link collection into a pass #52800
Conversation
This comment has been minimized.
This comment has been minimized.
An analysis of the bug that caused
//! A macro for defining #[cfg] if-else statements.
//! A `Bytes` handle can be created directly from an existing byte store (such as &[u8]
//! or Vec<u8>), but usually a `BytesMut` is used first and written to. For
//! example:
When rustdoc processes a crate, it currently processes intra-doc-links as soon as the item is "cleaned". This is fairly early in the process, and occurs before any decision of whether to show a given item's documentation has been made. (Sure, we have a sense of whether it's in a public module, but not whether it's been exported somewhere that is public.) Furthermore, whenever it finds a problem resolving a link, it reports an error immediately, again ignoring whether that item is relevant for the current doc run. Generally, whenever we encounter an external item, we only import its definition and attributes once we know we're going to display it. Either it's being used in a Which brings us back to My original reading of the issue is still valid, though, even if it's not the bug that created the issue. The other test i added also demonstrates this. A private item with a bad link target on it will currently report an error, despite not appearing in the documentation to create a broken link. |
a6d5075
to
08c1e72
Compare
Looks good to me! Please squash your tidy commit though. ;) |
260c641
to
85bf440
Compare
Now that #52751 is landed, i've rebased atop master so that commit doesn't show up in this one. |
Then let's get it in! @bors: r+ |
📌 Commit 85bf440f98cd634563d1d9a1e24cd5b6027917fe has been approved by |
🔒 Merge conflict This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again. How do I rebase?Assuming
You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial. Please avoid the "Resolve conflicts" button on GitHub. It uses Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Error message
|
@bors r- Wrongly rescheduled. |
85bf440
to
f3c7ea4
Compare
Rebased. |
f3c7ea4
to
e47dea7
Compare
@bors p=1 It seems that any time someone touches the current intra-doc links functionality, this PR gets a merge conflict because of how it's moving the code around. I just had to rebase again. |
@bors r=GuillaumeGomez |
📌 Commit e47dea72472b2f2f4b978b72b95b63edbb1d93e8 has been approved by |
⌛ Testing commit e47dea72472b2f2f4b978b72b95b63edbb1d93e8 with merge 1580002f9fa813f468c31d391b00d12399b8507b... |
💔 Test failed - status-appveyor |
...did i mess with rustdoc's exit code somehow? was that modified in the last week and i somehow missed it in my rebases?
|
Ohhhh, i see it now. The #![deny(intra_doc_link_resolution_failure)]
/// [intradoc::failure]
fn main() {
println!("Hello, world!");
} However, now that we're not running docs for private items, the lint that was being emitted there is no longer being emitted. I'll update the test. |
e16a2e4
to
bb4f588
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 |
bb4f588
to
e332985
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 |
I'm restarting the travis build. EDIT: I've been told travis people are looking at it, so i'll link their issue here so it's saved. travis-ci/travis-ci#4924 |
Travis is green, so let's get this rolling again... @bors r=GuillaumeGomez |
📌 Commit e332985 has been approved by |
rustdoc: refactor how passes are structured, and turn intra-doc-link collection into a pass This builds on #52751 and should not be merged until that finally finishes the bors queue Part 2 of my passes refactor. This introduces the concept of an "early pass", which is run right before exiting the compiler context. This is important for passes that may want to ask the compiler about things. For example, i took out the intra-doc-link collection and turned it into a early pass. I also made the `strip-hidden`, `strip-private` and `strip-priv-imports` passes occur as early passes, so that intra-doc-link collection wouldn't run on docs that weren't getting printed. Fixes #51684, technically #51468 too but that version of `h2` hits a legit intra-link error after that `>_>` r? @rust-lang/rustdoc
☀️ Test successful - status-appveyor, status-travis |
This builds on #52751 and should not be merged until that finally finishes the bors queue
Part 2 of my passes refactor. This introduces the concept of an "early pass", which is run right before exiting the compiler context. This is important for passes that may want to ask the compiler about things. For example, i took out the intra-doc-link collection and turned it into a early pass. I also made the
strip-hidden
,strip-private
andstrip-priv-imports
passes occur as early passes, so that intra-doc-link collection wouldn't run on docs that weren't getting printed.Fixes #51684, technically #51468 too but that version of
h2
hits a legit intra-link error after that>_>
r? @rust-lang/rustdoc