Only register hidden types for opaque types from the current crate, nothing else would work anyway.

This commit is contained in:
Oli Scherer 2022-07-08 13:59:44 +00:00
parent 0b863e0024
commit d6b93eb793
2 changed files with 2 additions and 1 deletions

View file

@ -101,7 +101,7 @@ pub fn handle_opaque_type(
}
let (a, b) = if a_is_expected { (a, b) } else { (b, a) };
let process = |a: Ty<'tcx>, b: Ty<'tcx>| match *a.kind() {
ty::Opaque(def_id, substs) => {
ty::Opaque(def_id, substs) if def_id.is_local() => {
let origin = if self.defining_use_anchor.is_some() {
// Check that this is `impl Trait` type is
// declared by `parent_def_id` -- i.e., one whose

View file

@ -1105,6 +1105,7 @@ pub fn is_empty(&self) -> bool {
Lift
)]
pub struct OpaqueTypeKey<'tcx> {
// FIXME(oli-obk): make this a LocalDefId
pub def_id: DefId,
pub substs: SubstsRef<'tcx>,
}