-
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
resolve: Scale back unloading of speculatively loaded crates #121167
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. Should we directly change the implementation of There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
||
/// A list of all traits in a crate, used by rustdoc and error reporting. | ||
query traits(_: CrateNum) -> &'tcx [DefId] { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
error: extern location for std does not exist: | ||
|
||
error: `#[panic_handler]` function required, but not found | ||
|
||
error: unwinding panics are not supported without std | ||
| | ||
= help: using nightly cargo, use -Zbuild-std with panic="abort" to avoid unwinding | ||
= note: since the core library is usually precompiled with panic="unwind", rebuilding your crate with panic="abort" may not be enough to fix the problem | ||
|
||
error: requires `sized` lang_item | ||
|
||
error: aborting due to 2 previous errors | ||
error: aborting due to 4 previous errors | ||
|
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.