Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 781cbf6

Browse files
oli-obkMark-Simulacrum
authored andcommitted
Only register hidden types for opaque types from the current crate, nothing else would work anyway.
1 parent 7371ad9 commit 781cbf6

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

compiler/rustc_infer/src/infer/opaque_types.rs

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

compiler/rustc_middle/src/ty/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,7 @@ impl<'tcx> InstantiatedPredicates<'tcx> {
10651065
Lift
10661066
)]
10671067
pub struct OpaqueTypeKey<'tcx> {
1068+
// FIXME(oli-obk): make this a LocalDefId
10681069
pub def_id: DefId,
10691070
pub substs: SubstsRef<'tcx>,
10701071
}

0 commit comments

Comments
 (0)