tcx.lift(&self.caller_bounds).map(|caller_bounds| {
ty::ParamEnv {
reveal: self.reveal,
- universe: self.universe,
caller_bounds,
}
})
}
}
-impl<'tcx> TypeFoldable<'tcx> for ty::ParamEnv<'tcx> {
- fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self {
- ty::ParamEnv {
- reveal: self.reveal,
- caller_bounds: self.caller_bounds.fold_with(folder),
- universe: self.universe.fold_with(folder),
- }
- }
-
- fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool {
- let &ty::ParamEnv { reveal: _, ref universe, ref caller_bounds } = self;
- universe.super_visit_with(visitor) || caller_bounds.super_visit_with(visitor)
- }
-}
-
-impl<'tcx> TypeFoldable<'tcx> for ty::UniverseIndex {
- fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, _folder: &mut F) -> Self {
- *self
- }
-
- fn super_visit_with<V: TypeVisitor<'tcx>>(&self, _visitor: &mut V) -> bool {
- false
- }
+BraceStructTypeFoldableImpl! {
+ impl<'tcx> TypeFoldable<'tcx> for ty::ParamEnv<'tcx> { reveal, caller_bounds }
}
impl<'tcx> TypeFoldable<'tcx> for &'tcx ty::Slice<ty::ExistentialPredicate<'tcx>> {