-
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
Revert "Don't load all extern crates unconditionally" #85749
Revert "Don't load all extern crates unconditionally" #85749
Conversation
This comment has been minimized.
This comment has been minimized.
a9ed792
to
6903f2d
Compare
This comment has been minimized.
This comment has been minimized.
6903f2d
to
e9dc8c3
Compare
Please remember to re-open #68427 if this gets merged. |
I will not have time to review this for a while. |
It's in the first message already. ;) |
I'd prefer to actually fix #84738 instead of reverting the PR and re-introducing other bugs. Waiting on minimized reproduction for #84738 - https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/crate.20loading.20during.20link.20resolution/near/240747900 |
Does https://github.com/rust-bitcoin/rust-lightning/blob/main/lightning-background-processor/src/lib.rs qualify as a minimized reproduction? Its only a few method crate and tickles the bug. The version on crates.io hits it. |
(I've returned from vacation and will look at this next weekend.) |
\o/ |
☔ The latest upstream changes (presumably #86489) made this pull request unmergeable. Please resolve the merge conflicts. |
r=me, this has been causing lots of trouble and we can always do a more proper fix later. @GuillaumeGomez can you fix the conflict real quick? |
On it! |
e9dc8c3
to
44424a3
Compare
This comment has been minimized.
This comment has been minimized.
44424a3
to
4188476
Compare
5386c93
to
5f0c54d
Compare
@bors r+ |
📌 Commit 5f0c54d has been approved by |
@rust-lang/rustdoc are you ok with backporting this? For context, this fixes a regression from 1.52 to 1.53 (an ICE on code when generating intra doc links). It does reintroduce the bug from #68427, but that's a very narrow edge case I don't expect most people to run into. |
I'm okay with the backport |
I am as well. I think you can set the label. :) |
4181738
to
5f0c54d
Compare
I erroneously pushed on this branch from another PR so I need to re-approve it. @bors: r=jyn514 |
📌 Commit 5f0c54d has been approved by |
…laumeGomez Rollup of 5 pull requests Successful merges: - rust-lang#85749 (Revert "Don't load all extern crates unconditionally") - rust-lang#86714 (Add linked list cursor end methods) - rust-lang#86737 (Document rustfmt on nightly-rustc) - rust-lang#86776 (Skip layout query when computing integer type size during mangling) - rust-lang#86797 (Stabilize `Bound::cloned()`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
[beta] backports - rustfmt: load nested out-of-line mods correctly rust-lang#86424 - Re-add support for parsing (and pretty-printing) inner-attributes in match body rust-lang#85193 - Revert "List trait impls before methods from deref in the sidebar ..." rust-lang#86564 - Revert "Don't load all extern crates unconditionally" rust-lang#85749 r? `@Mark-Simulacrum`
It looks like #68427 is still closed? |
…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`).
Fixes #84738.
This reverts #83738.
For the "smart" load of external crates, we need to be able to access their items in order to check their doc comments, which seems, if not impossible, quite complicated using only the AST.
For some context, I first tried to extend the
IntraLinkCrateLoader
visitor by addingvisit_foreign_item
. Unfortunately, it never enters into this call, so definitely not the right place...I then added
visit_use_tree
to then check all the imports outside with something like this:This was, of course, a failure. We find the items without problems, but we still can't go into the external crate to check its items' attributes.
Finally, @jyn514 suggested to look into the
CrateLoader
, but it only seems to provide metadata (I went throughCStore
andCrateMetadata
).I think we are too limited here (with AST only) to be able to determine the crates we actually need to import, but it's very likely that I missed something. Maybe @petrochenkov or @Aaron1011 have an idea?
So until we find a way to make it work completely, we need to revert it to fix the ICE. Once merged, we'll need to re-open #68427.
r? @jyn514