Skip to content

Commit ac0aabb

Browse files
committed
[DO NOT MERGE] Remove most of existing_match
1 parent b24c40e commit ac0aabb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

compiler/rustc_metadata/src/creader.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ impl CStore {
516516

517517
fn existing_match(
518518
&self,
519-
externs: &Externs,
519+
_externs: &Externs,
520520
name: Symbol,
521521
hash: Option<Svh>,
522522
) -> Option<CrateNum> {
@@ -535,6 +535,13 @@ impl CStore {
535535
None => {}
536536
}
537537

538+
/*
539+
if !data.used() {
540+
// Ignore speculatively loaded crates. Using them can hide ambiguity errors:
541+
// https://github.com/rust-lang/rust/issues/147966#issuecomment-3444198198
542+
continue;
543+
}
544+
538545
// When the hash is None we're dealing with a top-level dependency
539546
// in which case we may have a specification on the command line for
540547
// this library. Even though an upstream library may have loaded
@@ -563,6 +570,7 @@ impl CStore {
563570
// While the crate name matched, no --extern crate_name=path matched. It is possible
564571
// that we have already loaded the target crate, but if that happens CStore::load will
565572
// indicate so and we gracefully handle this, just potentially wasting a bit of time.
573+
*/
566574
}
567575

568576
None

0 commit comments

Comments
 (0)