1
Fork 0

Combine identical alias arms

This commit is contained in:
Michael Goulet 2022-11-27 17:52:17 +00:00
parent 61adaf8187
commit 96cb18e864
29 changed files with 69 additions and 120 deletions

View file

@ -651,12 +651,7 @@ impl<'tcx> TypeSuperFoldable<'tcx> for Ty<'tcx> {
}
ty::GeneratorWitness(types) => ty::GeneratorWitness(types.try_fold_with(folder)?),
ty::Closure(did, substs) => ty::Closure(did, substs.try_fold_with(folder)?),
ty::Alias(ty::Projection, data) => {
ty::Alias(ty::Projection, data.try_fold_with(folder)?)
}
ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs }) => {
ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs: substs.try_fold_with(folder)? })
}
ty::Alias(kind, data) => ty::Alias(kind, data.try_fold_with(folder)?),
ty::Bool
| ty::Char
@ -701,10 +696,7 @@ impl<'tcx> TypeSuperVisitable<'tcx> for Ty<'tcx> {
ty::Generator(_did, ref substs, _) => substs.visit_with(visitor),
ty::GeneratorWitness(ref types) => types.visit_with(visitor),
ty::Closure(_did, ref substs) => substs.visit_with(visitor),
ty::Alias(ty::Projection, ref data) => data.visit_with(visitor),
ty::Alias(ty::Opaque, ty::AliasTy { def_id: _, ref substs }) => {
substs.visit_with(visitor)
}
ty::Alias(_, ref data) => data.visit_with(visitor),
ty::Bool
| ty::Char