1
Fork 0

Remove TypeSuper{Foldable,Visitable} impls for Region.

These traits exist so that folders/visitors can recurse into types of
interest: binders, types, regions, predicates, and consts. But `Region`
is non-recursive and cannot contain other types of interest, so its
methods in these traits are trivial.

This commit inlines and removes those trivial methods.
This commit is contained in:
Nicholas Nethercote 2023-04-15 09:31:11 +10:00
parent d558796beb
commit 4460a1dc28
11 changed files with 51 additions and 66 deletions

View file

@ -583,24 +583,6 @@ impl<'tcx> TypeVisitable<TyCtxt<'tcx>> for ty::Region<'tcx> {
}
}
impl<'tcx> TypeSuperFoldable<TyCtxt<'tcx>> for ty::Region<'tcx> {
fn try_super_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>(
self,
_folder: &mut F,
) -> Result<Self, F::Error> {
Ok(self)
}
}
impl<'tcx> TypeSuperVisitable<TyCtxt<'tcx>> for ty::Region<'tcx> {
fn super_visit_with<V: TypeVisitor<TyCtxt<'tcx>>>(
&self,
_visitor: &mut V,
) -> ControlFlow<V::BreakTy> {
ControlFlow::Continue(())
}
}
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ty::Predicate<'tcx> {
fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>(
self,