@@ -126,7 +126,7 @@ fn check_fn_inner<'a, 'tcx>(
126
126
GenericArg :: Type ( _) => None ,
127
127
} ) ;
128
128
for bound in lifetimes {
129
- if bound. name . name ( ) != "'static" && !bound. is_elided ( ) {
129
+ if bound. name . ident ( ) . name != "'static" && !bound. is_elided ( ) {
130
130
return ;
131
131
}
132
132
bounds_lts. push ( bound) ;
@@ -240,7 +240,7 @@ fn allowed_lts_from(named_generics: &[GenericParam]) -> HashSet<RefLt> {
240
240
for par in named_generics. iter ( ) {
241
241
if let GenericParamKind :: Lifetime { .. } = par. kind {
242
242
if par. bounds . is_empty ( ) {
243
- allowed_lts. insert ( RefLt :: Named ( par. name . name ( ) ) ) ;
243
+ allowed_lts. insert ( RefLt :: Named ( par. name . ident ( ) . name ) ) ;
244
244
}
245
245
}
246
246
}
@@ -251,8 +251,8 @@ fn allowed_lts_from(named_generics: &[GenericParam]) -> HashSet<RefLt> {
251
251
252
252
fn lts_from_bounds < ' a , T : Iterator < Item = & ' a Lifetime > > ( mut vec : Vec < RefLt > , bounds_lts : T ) -> Vec < RefLt > {
253
253
for lt in bounds_lts {
254
- if lt. name . name ( ) != "'static" {
255
- vec. push ( RefLt :: Named ( lt. name . name ( ) ) ) ;
254
+ if lt. name . ident ( ) . name != "'static" {
255
+ vec. push ( RefLt :: Named ( lt. name . ident ( ) . name ) ) ;
256
256
}
257
257
}
258
258
@@ -282,12 +282,12 @@ impl<'v, 't> RefVisitor<'v, 't> {
282
282
283
283
fn record ( & mut self , lifetime : & Option < Lifetime > ) {
284
284
if let Some ( ref lt) = * lifetime {
285
- if lt. name . name ( ) == "'static" {
285
+ if lt. name . ident ( ) . name == "'static" {
286
286
self . lts . push ( RefLt :: Static ) ;
287
287
} else if lt. is_elided ( ) {
288
288
self . lts . push ( RefLt :: Unnamed ) ;
289
289
} else {
290
- self . lts . push ( RefLt :: Named ( lt. name . name ( ) ) ) ;
290
+ self . lts . push ( RefLt :: Named ( lt. name . ident ( ) . name ) ) ;
291
291
}
292
292
} else {
293
293
self . lts . push ( RefLt :: Unnamed ) ;
@@ -421,7 +421,7 @@ struct LifetimeChecker {
421
421
impl < ' tcx > Visitor < ' tcx > for LifetimeChecker {
422
422
// for lifetimes as parameters of generics
423
423
fn visit_lifetime ( & mut self , lifetime : & ' tcx Lifetime ) {
424
- self . map . remove ( & lifetime. name . name ( ) ) ;
424
+ self . map . remove ( & lifetime. name . ident ( ) . name ) ;
425
425
}
426
426
427
427
fn visit_generic_param ( & mut self , param : & ' tcx GenericParam ) {
@@ -442,7 +442,7 @@ impl<'tcx> Visitor<'tcx> for LifetimeChecker {
442
442
fn report_extra_lifetimes < ' a , ' tcx : ' a > ( cx : & LateContext < ' a , ' tcx > , func : & ' tcx FnDecl , generics : & ' tcx Generics ) {
443
443
let hs = generics. params . iter ( )
444
444
. filter_map ( |par| match par. kind {
445
- GenericParamKind :: Lifetime { .. } => Some ( ( par. name . name ( ) , par. span ) ) ,
445
+ GenericParamKind :: Lifetime { .. } => Some ( ( par. name . ident ( ) . name , par. span ) ) ,
446
446
_ => None ,
447
447
} )
448
448
. collect ( ) ;
@@ -463,7 +463,7 @@ struct BodyLifetimeChecker {
463
463
impl < ' tcx > Visitor < ' tcx > for BodyLifetimeChecker {
464
464
// for lifetimes as parameters of generics
465
465
fn visit_lifetime ( & mut self , lifetime : & ' tcx Lifetime ) {
466
- if lifetime. name . name ( ) != keywords:: Invalid . name ( ) && lifetime. name . name ( ) != "'static" {
466
+ if lifetime. name . ident ( ) . name != keywords:: Invalid . name ( ) && lifetime. name . ident ( ) . name != "'static" {
467
467
self . lifetimes_used_in_body = true ;
468
468
}
469
469
}
0 commit comments