1
1
use super :: {
2
2
Arm , Block , Expr , ExprKind , Guard , InlineAsmOperand , Pat , PatKind , Stmt , StmtKind , Thir ,
3
3
} ;
4
- use rustc_middle:: ty:: Const ;
5
4
6
5
pub trait Visitor < ' a , ' tcx : ' a > : Sized {
7
6
fn thir ( & self ) -> & ' a Thir < ' tcx > ;
@@ -25,8 +24,6 @@ pub trait Visitor<'a, 'tcx: 'a>: Sized {
25
24
fn visit_pat ( & mut self , pat : & Pat < ' tcx > ) {
26
25
walk_pat ( self , pat) ;
27
26
}
28
-
29
- fn visit_const ( & mut self , _cnst : Const < ' tcx > ) { }
30
27
}
31
28
32
29
pub fn walk_expr < ' a , ' tcx : ' a , V : Visitor < ' a , ' tcx > > ( visitor : & mut V , expr : & Expr < ' tcx > ) {
@@ -94,9 +91,8 @@ pub fn walk_expr<'a, 'tcx: 'a, V: Visitor<'a, 'tcx>>(visitor: &mut V, expr: &Exp
94
91
}
95
92
}
96
93
ConstBlock { did : _, substs : _ } => { }
97
- Repeat { value, count } => {
94
+ Repeat { value, count : _ } => {
98
95
visitor. visit_expr ( & visitor. thir ( ) [ value] ) ;
99
- visitor. visit_const ( count) ;
100
96
}
101
97
Array { ref fields } | Tuple { ref fields } => {
102
98
for & field in & * * fields {
@@ -125,7 +121,7 @@ pub fn walk_expr<'a, 'tcx: 'a, V: Visitor<'a, 'tcx>>(visitor: &mut V, expr: &Exp
125
121
Literal { lit : _, neg : _ } => { }
126
122
ScalarLiteral { lit : _, user_ty : _ } => { }
127
123
NamedConst { def_id : _, substs : _, user_ty : _ } => { }
128
- ConstParam { literal : _, def_id : _, user_ty : _ } => { }
124
+ ConstParam { literal : _, def_id : _ } => { }
129
125
StaticRef { alloc_id : _, ty : _, def_id : _ } => { }
130
126
InlineAsm { ref operands, template : _, options : _, line_spans : _ } => {
131
127
for op in & * * operands {
@@ -212,11 +208,8 @@ pub fn walk_pat<'a, 'tcx: 'a, V: Visitor<'a, 'tcx>>(visitor: &mut V, pat: &Pat<'
212
208
visitor. visit_pat ( & subpattern. pattern ) ;
213
209
}
214
210
}
215
- Constant { value } => visitor. visit_const ( * value) ,
216
- Range ( range) => {
217
- visitor. visit_const ( range. lo ) ;
218
- visitor. visit_const ( range. hi ) ;
219
- }
211
+ Constant { value : _ } => { }
212
+ Range ( _) => { }
220
213
Slice { prefix, slice, suffix } | Array { prefix, slice, suffix } => {
221
214
for subpattern in prefix {
222
215
visitor. visit_pat ( & subpattern) ;
0 commit comments