11use super :: {
22 Arm , Block , Expr , ExprKind , Guard , InlineAsmOperand , Pat , PatKind , Stmt , StmtKind , Thir ,
33} ;
4- use rustc_middle:: ty:: Const ;
54
65pub trait Visitor < ' a , ' tcx : ' a > : Sized {
76 fn thir ( & self ) -> & ' a Thir < ' tcx > ;
@@ -25,8 +24,6 @@ pub trait Visitor<'a, 'tcx: 'a>: Sized {
2524 fn visit_pat ( & mut self , pat : & Pat < ' tcx > ) {
2625 walk_pat ( self , pat) ;
2726 }
28-
29- fn visit_const ( & mut self , _cnst : Const < ' tcx > ) { }
3027}
3128
3229pub 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
9491 }
9592 }
9693 ConstBlock { did : _, substs : _ } => { }
97- Repeat { value, count } => {
94+ Repeat { value, count : _ } => {
9895 visitor. visit_expr ( & visitor. thir ( ) [ value] ) ;
99- visitor. visit_const ( count) ;
10096 }
10197 Array { ref fields } | Tuple { ref fields } => {
10298 for & field in & * * fields {
@@ -125,7 +121,7 @@ pub fn walk_expr<'a, 'tcx: 'a, V: Visitor<'a, 'tcx>>(visitor: &mut V, expr: &Exp
125121 Literal { lit : _, neg : _ } => { }
126122 ScalarLiteral { lit : _, user_ty : _ } => { }
127123 NamedConst { def_id : _, substs : _, user_ty : _ } => { }
128- ConstParam { literal : _, def_id : _, user_ty : _ } => { }
124+ ConstParam { literal : _, def_id : _ } => { }
129125 StaticRef { alloc_id : _, ty : _, def_id : _ } => { }
130126 InlineAsm { ref operands, template : _, options : _, line_spans : _ } => {
131127 for op in & * * operands {
@@ -212,11 +208,8 @@ pub fn walk_pat<'a, 'tcx: 'a, V: Visitor<'a, 'tcx>>(visitor: &mut V, pat: &Pat<'
212208 visitor. visit_pat ( & subpattern. pattern ) ;
213209 }
214210 }
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 ( _) => { }
220213 Slice { prefix, slice, suffix } | Array { prefix, slice, suffix } => {
221214 for subpattern in prefix {
222215 visitor. visit_pat ( & subpattern) ;
0 commit comments