Uh oh!
There was an error while loading. Please reload this page.
Reland #83738: "rustdoc: Don't load all extern crates unconditionally" - #88215
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Ugh, apparently github dropped my comment because I wrote it on a commit instead of the PR itself. Do you happen to have it in your email? If not I can try to rewrite it from memory, it was discussing exactly how this bug could happen and how I don't know how to test it with a UI test.
There was a problem hiding this comment.
No, I don't see any traces of the extended version of this comment in my mail.
There was a problem hiding this comment.
Ok, it went something like this: "inlining" is refering to doc(inline), not #[inline]. The test case for it would look something like:
// inner_cratepubfnfoo(){}// middle_crate/// Link to [inner_crate::foo]pubfnbar(){}// outer_cratepubuse middle_crate::bar;In particular, the first time inner_crate will be loaded is when resolving the links on bar, which I don't think this pass will catch because it doesn't look at the attributes of the original definition, only of the re-export.
I'm not sure how to test this with a UI test because it requires three nested crates, and AFAIK aux-build only supports two.
There was a problem hiding this comment.
Seems to work fine when testing locally though 🤷 so this is probably ok.
Uh oh!
There was an error while loading. Please reload this page.
This reverts commit 5f0c54d.
Uh oh!
There was an error while loading. Please reload this page.
petrochenkov
commented
Aug 22, 2021
r=me with #88215 (comment) addressed. |
- All attributes for an item need to be considered at once, they can't be considered a line at a time. - The top-level crate was not being visited. This bug was caught by `extern-crate-used-only-in-link`, which I'm very glad I added. - Make the loader private to the module, so that only one function is exposed.
jyn514
commented
Aug 26, 2021
@bors r=petrochenkov |
bors
commented
Aug 26, 2021
📌 Commit c60a370 has been approved by |
…arth Rollup of 11 pull requests Successful merges: - rust-lang#87832 (Fix debugger stepping behavior with `match` expressions) - rust-lang#88123 (Make spans for tuple patterns in E0023 more precise) - rust-lang#88215 (Reland rust-lang#83738: "rustdoc: Don't load all extern crates unconditionally") - rust-lang#88216 (Don't stabilize creation of TryReserveError instances) - rust-lang#88270 (Handle type ascription type ops in NLL HRTB diagnostics) - rust-lang#88289 (Fixes for LLVM change 0f45c16) - rust-lang#88320 (type_implements_trait consider obligation failure on overflow) - rust-lang#88332 (Add argument types tait tests) - rust-lang#88340 (Add `c_size_t` and `c_ssize_t` to `std::os::raw`.) - rust-lang#88346 (Revert "Add type of a let tait test impl trait straight in let") - rust-lang#88348 (Add field types tait tests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…trochenkov rustdoc: Go back to loading all external crates unconditionally This *continues* to cause regressions. This code will be unnecessary once access to the resolver happens fully before creating the tyctxt (rust-lang#83761), so load all crates unconditionally for now. To minimize churn, this leaves in the code for loading crates selectively. "Fixes" rust-lang#84738. Previously: rust-lang#83738, rust-lang#85749, rust-lang#88215 r? `@petrochenkov` cc `@camelid` (this should fix the "index out of bounds" error you had while looking up `crate_name`).
…ochenkov rustdoc: Go back to loading all external crates unconditionally This *continues* to cause regressions. This code will be unnecessary once access to the resolver happens fully before creating the tyctxt (rust-lang#83761), so load all crates unconditionally for now. To minimize churn, this leaves in the code for loading crates selectively. "Fixes" rust-lang#84738. Previously: rust-lang#83738, rust-lang#85749, rust-lang#88215 r? `@petrochenkov` cc `@camelid` (this should fix the "index out of bounds" error you had while looking up `crate_name`).
I hopefully found all the bugs 🤞 time for a take two. See the last commit for details on what went wrong before.
r? @petrochenkov (but feel free to reassign to Guillaume if you don't have time.)
Closes#68427. Includes a fix for #84738.