@@ -113,7 +113,7 @@ fn check_fn_inner<'a, 'tcx>(
113
113
. parameters
114
114
. lifetimes ;
115
115
for bound in bounds {
116
- if bound. name != "'static" && !bound. is_elided ( ) {
116
+ if bound. name . name ( ) != "'static" && !bound. is_elided ( ) {
117
117
return ;
118
118
}
119
119
bounds_lts. push ( bound) ;
@@ -225,7 +225,7 @@ fn allowed_lts_from(named_lts: &[LifetimeDef]) -> HashSet<RefLt> {
225
225
let mut allowed_lts = HashSet :: new ( ) ;
226
226
for lt in named_lts {
227
227
if lt. bounds . is_empty ( ) {
228
- allowed_lts. insert ( RefLt :: Named ( lt. lifetime . name ) ) ;
228
+ allowed_lts. insert ( RefLt :: Named ( lt. lifetime . name . name ( ) ) ) ;
229
229
}
230
230
}
231
231
allowed_lts. insert ( RefLt :: Unnamed ) ;
@@ -235,8 +235,8 @@ fn allowed_lts_from(named_lts: &[LifetimeDef]) -> HashSet<RefLt> {
235
235
236
236
fn lts_from_bounds < ' a , T : Iterator < Item = & ' a Lifetime > > ( mut vec : Vec < RefLt > , bounds_lts : T ) -> Vec < RefLt > {
237
237
for lt in bounds_lts {
238
- if lt. name != "'static" {
239
- vec. push ( RefLt :: Named ( lt. name ) ) ;
238
+ if lt. name . name ( ) != "'static" {
239
+ vec. push ( RefLt :: Named ( lt. name . name ( ) ) ) ;
240
240
}
241
241
}
242
242
@@ -266,12 +266,12 @@ impl<'v, 't> RefVisitor<'v, 't> {
266
266
267
267
fn record ( & mut self , lifetime : & Option < Lifetime > ) {
268
268
if let Some ( ref lt) = * lifetime {
269
- if lt. name == "'static" {
269
+ if lt. name . name ( ) == "'static" {
270
270
self . lts . push ( RefLt :: Static ) ;
271
271
} else if lt. is_elided ( ) {
272
272
self . lts . push ( RefLt :: Unnamed ) ;
273
273
} else {
274
- self . lts . push ( RefLt :: Named ( lt. name ) ) ;
274
+ self . lts . push ( RefLt :: Named ( lt. name . name ( ) ) ) ;
275
275
}
276
276
} else {
277
277
self . lts . push ( RefLt :: Unnamed ) ;
@@ -396,7 +396,7 @@ struct LifetimeChecker {
396
396
impl < ' tcx > Visitor < ' tcx > for LifetimeChecker {
397
397
// for lifetimes as parameters of generics
398
398
fn visit_lifetime ( & mut self , lifetime : & ' tcx Lifetime ) {
399
- self . map . remove ( & lifetime. name ) ;
399
+ self . map . remove ( & lifetime. name . name ( ) ) ;
400
400
}
401
401
402
402
fn visit_lifetime_def ( & mut self , _: & ' tcx LifetimeDef ) {
@@ -415,7 +415,7 @@ fn report_extra_lifetimes<'a, 'tcx: 'a>(cx: &LateContext<'a, 'tcx>, func: &'tcx
415
415
let hs = generics
416
416
. lifetimes
417
417
. iter ( )
418
- . map ( |lt| ( lt. lifetime . name , lt. lifetime . span ) )
418
+ . map ( |lt| ( lt. lifetime . name . name ( ) , lt. lifetime . span ) )
419
419
. collect ( ) ;
420
420
let mut checker = LifetimeChecker { map : hs } ;
421
421
@@ -434,7 +434,7 @@ struct BodyLifetimeChecker {
434
434
impl < ' tcx > Visitor < ' tcx > for BodyLifetimeChecker {
435
435
// for lifetimes as parameters of generics
436
436
fn visit_lifetime ( & mut self , lifetime : & ' tcx Lifetime ) {
437
- if lifetime. name != keywords:: Invalid . name ( ) && lifetime. name != "'static" {
437
+ if lifetime. name . name ( ) != keywords:: Invalid . name ( ) && lifetime. name . name ( ) != "'static" {
438
438
self . lifetimes_used_in_body = true ;
439
439
}
440
440
}
0 commit comments