From eb779038de59e028ebbd6533072acec7b5fc98af Mon Sep 17 00:00:00 2001 From: ouz-a Date: Thu, 28 Sep 2023 19:51:49 +0300 Subject: [PATCH] simplify visit --- compiler/stable_mir/src/visitor.rs | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/compiler/stable_mir/src/visitor.rs b/compiler/stable_mir/src/visitor.rs index 848a3114b6b56..961009581388d 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(&self, visitor: &mut V) -> ControlFlow { - 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(&self, _: &mut V) -> ControlFlow { ControlFlow::Continue(()) } } -impl Visitable for BoundRegion { - fn super_visit(&self, visitor: &mut V) -> ControlFlow { - self.kind.visit(visitor) - } -} - -impl Visitable for BoundRegionKind { - fn super_visit(&self, _visitor: &mut V) -> ControlFlow { - match self { - BoundRegionKind::BrAnon => ControlFlow::Continue(()), - BoundRegionKind::BrNamed(_, _) => ControlFlow::Continue(()), - BoundRegionKind::BrEnv => ControlFlow::Continue(()), - } - } -} - impl Visitable for GenericArgKind { fn super_visit(&self, visitor: &mut V) -> ControlFlow { match self {