-
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
resolve: Scale back unloading of speculatively loaded crates #121167
Conversation
r? @wesleywiser rustbot has assigned @wesleywiser. Use r? to explicitly pick a reviewer |
Why #120830 had issues:
Both issues are potentially fixable. There may be other issues though. |
query used_crates(_: ()) -> &'tcx [CrateNum] { | ||
eval_always | ||
desc { "fetching `CrateNum`s for all crates loaded non-speculatively" } | ||
} |
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.
Should we directly change the implementation of crates
?
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.
In some cases the new version should not be used (e.g. in metadata encoding due to #121167 (comment)), but I didn't audit in which exactly and switched only one case that is necessary for #117772.
@@ -1872,6 +1872,13 @@ rustc_queries! { | |||
eval_always | |||
desc { "fetching all foreign CrateNum instances" } | |||
} | |||
// Crates that are loaded non-speculatively (not for diagnostics or doc links). | |||
// FIXME: This is currently only used for collecting lang items, but should be used instead of | |||
// `crates` in most other cases too. |
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.
Can we describe what situations would require using crates
instead or is there not a common theme?
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.
Metadata encoding at least, if the second item in #121167 (comment) is not fixed.
If metadata includes unused crates, then SVH and binary depinfo should probably include them either.
Any diagnostic logic, like trimmed_def_paths
may include them as well, because why not.
Lang item collection, impl collection, linking certainly shouldn't include speculatively loaded crates.
This comment was marked as resolved.
This comment was marked as resolved.
c2f2714
to
24cffbf
Compare
Thanks for the quick fix @petrochenkov! @bors r+ |
resolve: Scale back unloading of speculatively loaded crates Fixes rust-lang#120830 and fixes rust-lang#120909 while still unblocking rust-lang#117772. I cannot reproduce https://github.com/parasyte/crash-rustc as an UI test for some reason, but I tested all the cases linked above manually.
Rollup of 8 pull requests Successful merges: - rust-lang#121167 (resolve: Scale back unloading of speculatively loaded crates) - rust-lang#121196 (Always inline check in `assert_unsafe_precondition` with cfg(debug_assertions)) - rust-lang#121206 (Top level error handling) - rust-lang#121223 (intrinsics::simd: add missing functions) - rust-lang#121241 (Implement `NonZero` traits generically.) - rust-lang#121242 (Generate `getelementptr` instead of `inttoptr` for `ptr::invalid`) - rust-lang#121278 (Remove the "codegen" profile from bootstrap) - rust-lang#121286 (Rename `ConstPropLint` to `KnownPanicsLint`) r? `@ghost` `@rustbot` modify labels: rollup
resolve: Scale back unloading of speculatively loaded crates Fixes rust-lang#120830 and fixes rust-lang#120909 while still unblocking rust-lang#117772. I cannot reproduce https://github.com/parasyte/crash-rustc as an UI test for some reason, but I tested all the cases linked above manually.
Rollup of 8 pull requests Successful merges: - rust-lang#121167 (resolve: Scale back unloading of speculatively loaded crates) - rust-lang#121196 (Always inline check in `assert_unsafe_precondition` with cfg(debug_assertions)) - rust-lang#121241 (Implement `NonZero` traits generically.) - rust-lang#121278 (Remove the "codegen" profile from bootstrap) - rust-lang#121286 (Rename `ConstPropLint` to `KnownPanicsLint`) - rust-lang#121291 (target: Revert default to the medium code model on LoongArch targets) - rust-lang#121302 (Remove `RefMutL` hack in `proc_macro::bridge`) - rust-lang#121318 (Trigger `unsafe_code` lint on invocations of `global_asm`) Failed merges: - rust-lang#121206 (Top level error handling) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#121167 - petrochenkov:unload2, r=wesleywiser resolve: Scale back unloading of speculatively loaded crates Fixes rust-lang#120830 and fixes rust-lang#120909 while still unblocking rust-lang#117772. I cannot reproduce https://github.com/parasyte/crash-rustc as an UI test for some reason, but I tested all the cases linked above manually.
rustc: Use `tcx.used_crates(())` more And explain when it should be used. Addresses comments from rust-lang#121167.
rustc: Use `tcx.used_crates(())` more And explain when it should be used. Addresses comments from rust-lang#121167.
rustc: Use `tcx.used_crates(())` more And explain when it should be used. Addresses comments from rust-lang#121167.
Rollup merge of rust-lang#124976 - petrochenkov:usedcrates, r=oli-obk rustc: Use `tcx.used_crates(())` more And explain when it should be used. Addresses comments from rust-lang#121167.
rustc: Use `tcx.used_crates(())` more And explain when it should be used. Addresses comments from rust-lang/rust#121167.
rustc: Use `tcx.used_crates(())` more And explain when it should be used. Addresses comments from rust-lang/rust#121167.
Fixes #120830 and fixes #120909 while still unblocking #117772.
I cannot reproduce https://github.com/parasyte/crash-rustc as an UI test for some reason, but I tested all the cases linked above manually.