@@ -195,7 +195,6 @@ impl<'a, 'v> Visitor<'v> for LifetimeContext<'a> {
195
195
fn visit_ty ( & mut self , ty : & hir:: Ty ) {
196
196
match ty. node {
197
197
hir:: TyBareFn ( ref c) => {
198
- visit:: walk_lifetime_decls_helper ( self , & c. lifetimes ) ;
199
198
self . with ( LateScope ( & c. lifetimes , self . scope ) , |old_scope, this| {
200
199
// a bare fn has no bounds, so everything
201
200
// contained within is scoped within its binder.
@@ -245,7 +244,7 @@ impl<'a, 'v> Visitor<'v> for LifetimeContext<'a> {
245
244
|_, this| visit:: walk_block ( this, b) ) ;
246
245
}
247
246
248
- fn visit_lifetime_ref ( & mut self , lifetime_ref : & hir:: Lifetime ) {
247
+ fn visit_lifetime ( & mut self , lifetime_ref : & hir:: Lifetime ) {
249
248
if lifetime_ref. name == special_idents:: static_lifetime. name {
250
249
self . insert_lifetime ( lifetime_ref, DefStaticRegion ) ;
251
250
return ;
@@ -255,7 +254,7 @@ impl<'a, 'v> Visitor<'v> for LifetimeContext<'a> {
255
254
256
255
fn visit_generics ( & mut self , generics : & hir:: Generics ) {
257
256
for ty_param in generics. ty_params . iter ( ) {
258
- visit :: walk_ty_param_bounds_helper ( self , & ty_param. bounds ) ;
257
+ walk_list ! ( self , visit_ty_param_bound , & ty_param. bounds) ;
259
258
match ty_param. default {
260
259
Some ( ref ty) => self . visit_ty ( & * * ty) ,
261
260
None => { }
@@ -273,22 +272,22 @@ impl<'a, 'v> Visitor<'v> for LifetimeContext<'a> {
273
272
|old_scope, this| {
274
273
this. check_lifetime_defs ( old_scope, bound_lifetimes) ;
275
274
this. visit_ty ( & * * bounded_ty) ;
276
- visit :: walk_ty_param_bounds_helper ( this, bounds) ;
275
+ walk_list ! ( this, visit_ty_param_bound , bounds) ;
277
276
} ) ;
278
277
self . trait_ref_hack = false ;
279
278
result
280
279
} else {
281
280
self . visit_ty ( & * * bounded_ty) ;
282
- visit :: walk_ty_param_bounds_helper ( self , bounds) ;
281
+ walk_list ! ( self , visit_ty_param_bound , bounds) ;
283
282
}
284
283
}
285
284
& hir:: WherePredicate :: RegionPredicate ( hir:: WhereRegionPredicate { ref lifetime,
286
285
ref bounds,
287
286
.. } ) => {
288
287
289
- self . visit_lifetime_ref ( lifetime) ;
288
+ self . visit_lifetime ( lifetime) ;
290
289
for bound in bounds {
291
- self . visit_lifetime_ref ( bound) ;
290
+ self . visit_lifetime ( bound) ;
292
291
}
293
292
}
294
293
& hir:: WherePredicate :: EqPredicate ( hir:: WhereEqPredicate { id,
@@ -799,23 +798,23 @@ fn early_bound_lifetime_names(generics: &hir::Generics) -> Vec<ast::Name> {
799
798
FreeLifetimeCollector { early_bound : & mut early_bound,
800
799
late_bound : & mut late_bound } ;
801
800
for ty_param in generics. ty_params . iter ( ) {
802
- visit :: walk_ty_param_bounds_helper ( & mut collector, & ty_param. bounds ) ;
801
+ walk_list ! ( & mut collector, visit_ty_param_bound , & ty_param. bounds) ;
803
802
}
804
803
for predicate in & generics. where_clause . predicates {
805
804
match predicate {
806
805
& hir:: WherePredicate :: BoundPredicate ( hir:: WhereBoundPredicate { ref bounds,
807
806
ref bounded_ty,
808
807
..} ) => {
809
808
collector. visit_ty ( & * * bounded_ty) ;
810
- visit :: walk_ty_param_bounds_helper ( & mut collector, bounds) ;
809
+ walk_list ! ( & mut collector, visit_ty_param_bound , bounds) ;
811
810
}
812
811
& hir:: WherePredicate :: RegionPredicate ( hir:: WhereRegionPredicate { ref lifetime,
813
812
ref bounds,
814
813
..} ) => {
815
- collector. visit_lifetime_ref ( lifetime) ;
814
+ collector. visit_lifetime ( lifetime) ;
816
815
817
816
for bound in bounds {
818
- collector. visit_lifetime_ref ( bound) ;
817
+ collector. visit_lifetime ( bound) ;
819
818
}
820
819
}
821
820
& hir:: WherePredicate :: EqPredicate ( _) => unimplemented ! ( )
@@ -843,7 +842,7 @@ fn early_bound_lifetime_names(generics: &hir::Generics) -> Vec<ast::Name> {
843
842
}
844
843
845
844
impl < ' a , ' v > Visitor < ' v > for FreeLifetimeCollector < ' a > {
846
- fn visit_lifetime_ref ( & mut self , lifetime_ref : & hir:: Lifetime ) {
845
+ fn visit_lifetime ( & mut self , lifetime_ref : & hir:: Lifetime ) {
847
846
shuffle ( self . early_bound , self . late_bound ,
848
847
lifetime_ref. name ) ;
849
848
}
0 commit comments