Add TypeVisitor::visit_mir_const
.
Because `TypeFoldable::try_fold_mir_const` exists, and even though `visit_mir_const` isn't needed right now, the consistency makes the code easier to understand.
This commit is contained in:
parent
ca7585ab9a
commit
6ba2dfd330
@ -406,4 +406,8 @@ impl<'tcx> TypeFoldable<'tcx> for ConstantKind<'tcx> {
|
||||
ConstantKind::Val(_, t) => t.visit_with(visitor),
|
||||
}
|
||||
}
|
||||
|
||||
fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> ControlFlow<V::BreakTy> {
|
||||
visitor.visit_mir_const(*self)
|
||||
}
|
||||
}
|
||||
|
@ -392,6 +392,10 @@ pub trait TypeVisitor<'tcx>: Sized {
|
||||
fn visit_predicate(&mut self, p: ty::Predicate<'tcx>) -> ControlFlow<Self::BreakTy> {
|
||||
p.super_visit_with(self)
|
||||
}
|
||||
|
||||
fn visit_mir_const(&mut self, c: mir::ConstantKind<'tcx>) -> ControlFlow<Self::BreakTy> {
|
||||
c.super_visit_with(self)
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
x
Reference in New Issue
Block a user