introduce mir::Unevaluated

This commit is contained in:
b-naber
2022-09-19 19:46:53 +02:00
parent 3e50038a2d
commit 9f3784df89
32 changed files with 166 additions and 132 deletions

View File

@@ -128,7 +128,11 @@ pub trait TypeFolder<'tcx>: FallibleTypeFolder<'tcx, Error = !> {
c.super_fold_with(self)
}
fn fold_unevaluated(&mut self, uv: ty::Unevaluated<'tcx>) -> ty::Unevaluated<'tcx> {
fn fold_ty_unevaluated(&mut self, uv: ty::Unevaluated<'tcx>) -> ty::Unevaluated<'tcx> {
uv.super_fold_with(self)
}
fn fold_mir_unevaluated(&mut self, uv: mir::Unevaluated<'tcx>) -> mir::Unevaluated<'tcx> {
uv.super_fold_with(self)
}
@@ -172,13 +176,20 @@ pub trait FallibleTypeFolder<'tcx>: Sized {
c.try_super_fold_with(self)
}
fn try_fold_unevaluated(
fn try_fold_ty_unevaluated(
&mut self,
c: ty::Unevaluated<'tcx>,
) -> Result<ty::Unevaluated<'tcx>, Self::Error> {
c.try_super_fold_with(self)
}
fn try_fold_mir_unevaluated(
&mut self,
c: mir::Unevaluated<'tcx>,
) -> Result<mir::Unevaluated<'tcx>, Self::Error> {
c.try_super_fold_with(self)
}
fn try_fold_predicate(
&mut self,
p: ty::Predicate<'tcx>,
@@ -225,11 +236,18 @@ where
Ok(self.fold_const(c))
}
fn try_fold_unevaluated(
fn try_fold_ty_unevaluated(
&mut self,
c: ty::Unevaluated<'tcx>,
) -> Result<ty::Unevaluated<'tcx>, !> {
Ok(self.fold_unevaluated(c))
Ok(self.fold_ty_unevaluated(c))
}
fn try_fold_mir_unevaluated(
&mut self,
c: mir::Unevaluated<'tcx>,
) -> Result<mir::Unevaluated<'tcx>, !> {
Ok(self.fold_mir_unevaluated(c))
}
fn try_fold_predicate(&mut self, p: ty::Predicate<'tcx>) -> Result<ty::Predicate<'tcx>, !> {