diff options
| author | ouz-a <ouz.agz@gmail.com> | 2023-09-28 19:51:49 +0300 |
|---|---|---|
| committer | ouz-a <ouz.agz@gmail.com> | 2023-09-28 19:51:49 +0300 |
| commit | eb779038de59e028ebbd6533072acec7b5fc98af (patch) | |
| tree | b826fe4576b2c00c6ee870ccbd0f8ca03476b331 | |
| parent | 0cca109473161c5c71de53d8ea0c9b7ff0a9b5c4 (diff) | |
| download | rust-eb779038de59e028ebbd6533072acec7b5fc98af.tar.gz rust-eb779038de59e028ebbd6533072acec7b5fc98af.zip | |
simplify visit
| -rw-r--r-- | compiler/stable_mir/src/visitor.rs | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/compiler/stable_mir/src/visitor.rs b/compiler/stable_mir/src/visitor.rs index 848a3114b6b..96100958138 100644 --- a/compiler/stable_mir/src/visitor.rs +++ b/compiler/stable_mir/src/visitor.rs @@ -1,9 +1,6 @@ use std::ops::ControlFlow; -use crate::{ - ty::{BoundRegion, BoundRegionKind}, - Opaque, -}; +use crate::Opaque; use super::ty::{ Allocation, Binder, Const, ConstDef, ExistentialPredicate, FnSig, GenericArgKind, GenericArgs, @@ -112,34 +109,11 @@ impl Visitable for Region { visitor.visit_reg(self) } - fn super_visit<V: Visitor>(&self, visitor: &mut V) -> ControlFlow<V::Break> { - match self.kind.clone() { - crate::ty::RegionKind::ReEarlyBound(_) => {} - crate::ty::RegionKind::ReLateBound(_, bound_reg) => bound_reg.visit(visitor)?, - crate::ty::RegionKind::ReStatic => {} - crate::ty::RegionKind::RePlaceholder(bound_reg) => bound_reg.bound.visit(visitor)?, - crate::ty::RegionKind::ReErased => {} - } + fn super_visit<V: Visitor>(&self, _: &mut V) -> ControlFlow<V::Break> { ControlFlow::Continue(()) } } -impl Visitable for BoundRegion { - fn super_visit<V: Visitor>(&self, visitor: &mut V) -> ControlFlow<V::Break> { - self.kind.visit(visitor) - } -} - -impl Visitable for BoundRegionKind { - fn super_visit<V: Visitor>(&self, _visitor: &mut V) -> ControlFlow<V::Break> { - match self { - BoundRegionKind::BrAnon => ControlFlow::Continue(()), - BoundRegionKind::BrNamed(_, _) => ControlFlow::Continue(()), - BoundRegionKind::BrEnv => ControlFlow::Continue(()), - } - } -} - impl Visitable for GenericArgKind { fn super_visit<V: Visitor>(&self, visitor: &mut V) -> ControlFlow<V::Break> { match self { |
