Collapse placeholders to root universe in canonicalizer if not preserving universes
This commit is contained in:
parent
f4a4a31479
commit
ec40b1a393
3 changed files with 53 additions and 6 deletions
|
@ -418,10 +418,15 @@ impl<'cx, 'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'cx, 'tcx> {
|
|||
bug!("encountered a fresh type during canonicalization")
|
||||
}
|
||||
|
||||
ty::Placeholder(placeholder) => self.canonicalize_ty_var(
|
||||
CanonicalVarInfo { kind: CanonicalVarKind::PlaceholderTy(placeholder) },
|
||||
t,
|
||||
),
|
||||
ty::Placeholder(mut placeholder) => {
|
||||
if !self.canonicalize_mode.preserve_universes() {
|
||||
placeholder.universe = ty::UniverseIndex::ROOT;
|
||||
}
|
||||
self.canonicalize_ty_var(
|
||||
CanonicalVarInfo { kind: CanonicalVarKind::PlaceholderTy(placeholder) },
|
||||
t,
|
||||
)
|
||||
}
|
||||
|
||||
ty::Bound(debruijn, _) => {
|
||||
if debruijn >= self.binder_index {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue