Skip to content

Commit eb77903

Browse files
committed
simplify visit
1 parent 0cca109 commit eb77903

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

compiler/stable_mir/src/visitor.rs

+2-28
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
use std::ops::ControlFlow;
22

3-
use crate::{
4-
ty::{BoundRegion, BoundRegionKind},
5-
Opaque,
6-
};
3+
use crate::Opaque;
74

85
use super::ty::{
96
Allocation, Binder, Const, ConstDef, ExistentialPredicate, FnSig, GenericArgKind, GenericArgs,
@@ -112,34 +109,11 @@ impl Visitable for Region {
112109
visitor.visit_reg(self)
113110
}
114111

115-
fn super_visit<V: Visitor>(&self, visitor: &mut V) -> ControlFlow<V::Break> {
116-
match self.kind.clone() {
117-
crate::ty::RegionKind::ReEarlyBound(_) => {}
118-
crate::ty::RegionKind::ReLateBound(_, bound_reg) => bound_reg.visit(visitor)?,
119-
crate::ty::RegionKind::ReStatic => {}
120-
crate::ty::RegionKind::RePlaceholder(bound_reg) => bound_reg.bound.visit(visitor)?,
121-
crate::ty::RegionKind::ReErased => {}
122-
}
112+
fn super_visit<V: Visitor>(&self, _: &mut V) -> ControlFlow<V::Break> {
123113
ControlFlow::Continue(())
124114
}
125115
}
126116

127-
impl Visitable for BoundRegion {
128-
fn super_visit<V: Visitor>(&self, visitor: &mut V) -> ControlFlow<V::Break> {
129-
self.kind.visit(visitor)
130-
}
131-
}
132-
133-
impl Visitable for BoundRegionKind {
134-
fn super_visit<V: Visitor>(&self, _visitor: &mut V) -> ControlFlow<V::Break> {
135-
match self {
136-
BoundRegionKind::BrAnon => ControlFlow::Continue(()),
137-
BoundRegionKind::BrNamed(_, _) => ControlFlow::Continue(()),
138-
BoundRegionKind::BrEnv => ControlFlow::Continue(()),
139-
}
140-
}
141-
}
142-
143117
impl Visitable for GenericArgKind {
144118
fn super_visit<V: Visitor>(&self, visitor: &mut V) -> ControlFlow<V::Break> {
145119
match self {

0 commit comments

Comments
 (0)