Skip to content

Commit

Permalink
Auto merge of #126068 - lqd:revert-124976, r=petrochenkov
Browse files Browse the repository at this point in the history
Revert "use `tcx.used_crates(())` more" before it reaches beta

There are more open issues caused by #124976 than will be fixed by #125493 alone. The beta cut is soon, so let's revert it and buy some time to analyze and fix these issues in our own time.

fixes rust-lang/rust#125474
fixes rust-lang/rust#125484
fixes rust-lang/rust#125646
fixes rust-lang/rust#125707
fixes #126066
fixes #125934
fixes rust-lang/rust#126021

r? `@petrochenkov`
`@bors` p=1
  • Loading branch information
bors committed Jun 6, 2024
2 parents 23c2c7f + fc696ea commit b8b047f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ fn try_resolve_did(tcx: TyCtxt<'_>, path: &[&str], namespace: Option<Namespace>)
// the one in the sysroot and the one locally built by `cargo test`.)
// FIXME: can we prefer the one from the sysroot?
'crates: for krate in
tcx.used_crates(()).iter().filter(|&&krate| tcx.crate_name(krate).as_str() == crate_name)
tcx.crates(()).iter().filter(|&&krate| tcx.crate_name(krate).as_str() == crate_name)
{
let mut cur_item = DefId { krate: *krate, index: CRATE_DEF_INDEX };
// Go over the modules.
Expand Down Expand Up @@ -1364,7 +1364,7 @@ pub fn get_local_crates(tcx: TyCtxt<'_>) -> Vec<CrateNum> {
.map(|crates| crates.split(',').map(|krate| krate.to_string()).collect::<Vec<_>>())
.unwrap_or_default();
let mut local_crates = Vec::new();
for &crate_num in tcx.crates_including_speculative(()) {
for &crate_num in tcx.crates(()) {
let name = tcx.crate_name(crate_num);
let name = name.as_str();
if local_crate_names.iter().any(|local_name| local_name == name) {
Expand Down

0 comments on commit b8b047f

Please sign in to comment.