1
Fork 0

Rollup merge of #122907 - compiler-errors:uniquify-reerror, r=lcnr

Uniquify `ReError` on input mode in canonicalizer

See test descr

Fixes #122861

r? lcnr
This commit is contained in:
Matthias Krüger 2024-03-24 01:05:53 +01:00 committed by GitHub
commit cb03714e6f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 50 additions and 2 deletions

View file

@ -239,7 +239,7 @@ impl<Infcx: InferCtxtLike<Interner = I>, I: Interner> TypeFolder<I>
// FIXME: We should investigate the perf implications of not uniquifying
// `ReErased`. We may be able to short-circuit registering region
// obligations if we encounter a `ReErased` on one side, for example.
ty::ReStatic | ty::ReErased => match self.canonicalize_mode {
ty::ReStatic | ty::ReErased | ty::ReError(_) => match self.canonicalize_mode {
CanonicalizeMode::Input => CanonicalVarKind::Region(ty::UniverseIndex::ROOT),
CanonicalizeMode::Response { .. } => return r,
},
@ -277,7 +277,6 @@ impl<Infcx: InferCtxtLike<Interner = I>, I: Interner> TypeFolder<I>
}
}
}
ty::ReError(_) => return r,
};
let existing_bound_var = match self.canonicalize_mode {