@@ -15,10 +15,6 @@ macro_rules! mutability_dependent {
15
15
fn visit_assoc_item( & mut self , i: & ' ast AssocItem , ctxt: AssocCtxt ) -> Self :: Result {
16
16
walk_assoc_item( self , i, ctxt)
17
17
}
18
- // FIXME: inconsistent
19
- fn visit_lifetime( & mut self , lifetime: & ' ast Lifetime , _: LifetimeCtxt ) -> Self :: Result {
20
- walk_lifetime( self , lifetime)
21
- }
22
18
fn visit_mac_def( & mut self , _mac: & ' ast MacroDef , _id: NodeId ) -> Self :: Result {
23
19
Self :: Result :: output( )
24
20
}
@@ -98,10 +94,6 @@ macro_rules! mutability_dependent {
98
94
noop_filter_map_expr( self , e)
99
95
}
100
96
101
- fn visit_lifetime( & mut self , l: & mut Lifetime ) {
102
- walk_lifetime( self , l) ;
103
- }
104
-
105
97
fn visit_macro_def( & mut self , def: & mut MacroDef ) {
106
98
walk_macro_def( self , def) ;
107
99
}
@@ -358,6 +350,10 @@ macro_rules! make_ast_visitor {
358
350
fn visit_path( & mut self , path: ref_t!( Path ) , _id: NodeId ) -> result!( ) {
359
351
walk_path( self , path)
360
352
}
353
+
354
+ fn visit_lifetime( & mut self , lifetime: ref_t!( Lifetime ) , _: LifetimeCtxt ) -> result!( ) {
355
+ walk_lifetime( self , lifetime)
356
+ }
361
357
}
362
358
363
359
macro_rules! visit_span {
@@ -1759,7 +1755,7 @@ pub mod mut_visit {
1759
1755
use crate :: ptr:: P ;
1760
1756
use crate :: token:: { self , Token } ;
1761
1757
use crate :: tokenstream:: * ;
1762
- use crate :: visit:: { AssocCtxt , BoundKind } ;
1758
+ use crate :: visit:: { AssocCtxt , BoundKind , LifetimeCtxt } ;
1763
1759
1764
1760
pub trait ExpectOne < A : Array > {
1765
1761
fn expect_one ( self , err : & ' static str ) -> A :: Item ;
@@ -1905,7 +1901,7 @@ pub mod mut_visit {
1905
1901
TyKind :: Slice ( ty) => vis. visit_ty ( ty) ,
1906
1902
TyKind :: Ptr ( mt) => vis. visit_mt ( mt) ,
1907
1903
TyKind :: Ref ( lt, mt) => {
1908
- visit_opt ( lt, |lt| vis. visit_lifetime ( lt) ) ;
1904
+ visit_opt ( lt, |lt| vis. visit_lifetime ( lt, LifetimeCtxt :: Ref ) ) ;
1909
1905
vis. visit_mt ( mt) ;
1910
1906
}
1911
1907
TyKind :: BareFn ( bft) => {
@@ -1955,7 +1951,7 @@ pub mod mut_visit {
1955
1951
1956
1952
fn walk_generic_arg < T : MutVisitor > ( vis : & mut T , arg : & mut GenericArg ) {
1957
1953
match arg {
1958
- GenericArg :: Lifetime ( lt) => vis. visit_lifetime ( lt) ,
1954
+ GenericArg :: Lifetime ( lt) => vis. visit_lifetime ( lt, LifetimeCtxt :: GenericArg ) ,
1959
1955
GenericArg :: Type ( ty) => vis. visit_ty ( ty) ,
1960
1956
GenericArg :: Const ( ct) => vis. visit_anon_const ( ct) ,
1961
1957
}
@@ -2234,7 +2230,7 @@ pub mod mut_visit {
2234
2230
fn walk_precise_capturing_arg < T : MutVisitor > ( vis : & mut T , arg : & mut PreciseCapturingArg ) {
2235
2231
match arg {
2236
2232
PreciseCapturingArg :: Lifetime ( lt) => {
2237
- vis. visit_lifetime ( lt) ;
2233
+ vis. visit_lifetime ( lt, LifetimeCtxt :: GenericArg ) ;
2238
2234
}
2239
2235
PreciseCapturingArg :: Arg ( path, id) => {
2240
2236
vis. visit_id ( id) ;
@@ -2283,7 +2279,7 @@ pub mod mut_visit {
2283
2279
}
2284
2280
WherePredicate :: RegionPredicate ( rp) => {
2285
2281
let WhereRegionPredicate { span, lifetime, bounds } = rp;
2286
- vis. visit_lifetime ( lifetime) ;
2282
+ vis. visit_lifetime ( lifetime, LifetimeCtxt :: Bound ) ;
2287
2283
visit_vec ( bounds, |bound| vis. visit_param_bound ( bound, BoundKind :: Bound ) ) ;
2288
2284
vis. visit_span ( span) ;
2289
2285
}
0 commit comments