Skip to content

Commit d6b93eb

Browse files
committed
Only register hidden types for opaque types from the current crate, nothing else would work anyway.
1 parent 0b863e0 commit d6b93eb

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

compiler/rustc_infer/src/infer/opaque_types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
101101
}
102102
let (a, b) = if a_is_expected { (a, b) } else { (b, a) };
103103
let process = |a: Ty<'tcx>, b: Ty<'tcx>| match *a.kind() {
104-
ty::Opaque(def_id, substs) => {
104+
ty::Opaque(def_id, substs) if def_id.is_local() => {
105105
let origin = if self.defining_use_anchor.is_some() {
106106
// Check that this is `impl Trait` type is
107107
// declared by `parent_def_id` -- i.e., one whose

compiler/rustc_middle/src/ty/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,7 @@ impl<'tcx> InstantiatedPredicates<'tcx> {
11051105
Lift
11061106
)]
11071107
pub struct OpaqueTypeKey<'tcx> {
1108+
// FIXME(oli-obk): make this a LocalDefId
11081109
pub def_id: DefId,
11091110
pub substs: SubstsRef<'tcx>,
11101111
}

0 commit comments

Comments
 (0)