1
Fork 0

Rollup merge of #124976 - petrochenkov:usedcrates, r=oli-obk

rustc: Use `tcx.used_crates(())` more

And explain when it should be used.

Addresses comments from https://github.com/rust-lang/rust/pull/121167.
This commit is contained in:
Matthias Krüger 2024-05-23 14:09:23 +02:00 committed by GitHub
commit eda4a35f36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 54 additions and 47 deletions

View file

@ -539,7 +539,7 @@ pub fn collect_debugger_visualizers_transitive(
tcx.debugger_visualizers(LOCAL_CRATE)
.iter()
.chain(
tcx.crates(())
tcx.used_crates(())
.iter()
.filter(|&cnum| {
let used_crate_source = tcx.used_crate_source(*cnum);
@ -849,7 +849,7 @@ impl CrateInfo {
// `compiler_builtins` are always placed last to ensure that they're linked correctly.
used_crates.extend(compiler_builtins);
let crates = tcx.crates(());
let crates = tcx.used_crates(());
let n_crates = crates.len();
let mut info = CrateInfo {
target_cpu,