Replace more manual TypeFoldable and TypeVisitable impls with derives

This commit is contained in:
Oli Scherer
2022-09-15 15:05:03 +00:00
parent a5ab8da1e2
commit 9d9306828c
5 changed files with 15 additions and 109 deletions

View File

@@ -1526,7 +1526,7 @@ impl<'tcx> TypeFoldable<'tcx> for ParamEnv<'tcx> {
Ok(ParamEnv::new(
self.caller_bounds().try_fold_with(folder)?,
self.reveal().try_fold_with(folder)?,
self.constness().try_fold_with(folder)?,
self.constness(),
))
}
}
@@ -1534,8 +1534,7 @@ impl<'tcx> TypeFoldable<'tcx> for ParamEnv<'tcx> {
impl<'tcx> TypeVisitable<'tcx> for ParamEnv<'tcx> {
fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> ControlFlow<V::BreakTy> {
self.caller_bounds().visit_with(visitor)?;
self.reveal().visit_with(visitor)?;
self.constness().visit_with(visitor)
self.reveal().visit_with(visitor)
}
}