@@ -100,7 +100,7 @@ impl LintPass for NonCamelCaseTypes {
100
100
}
101
101
102
102
impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for NonCamelCaseTypes {
103
- fn check_item ( & mut self , cx : & LateContext < ' a , ' tcx > , it : & ' tcx hir:: Item ) {
103
+ fn check_item ( & mut self , cx : & LateContext , it : & hir:: Item ) {
104
104
let extern_repr_count = it. attrs
105
105
. iter ( )
106
106
. filter ( |attr| {
@@ -133,9 +133,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonCamelCaseTypes {
133
133
}
134
134
}
135
135
136
- fn check_generics ( & mut self ,
137
- cx : & LateContext < ' a , ' tcx > ,
138
- it : & ' tcx hir:: Generics ) {
136
+ fn check_generics ( & mut self , cx : & LateContext , it : & hir:: Generics ) {
139
137
for gen in it. ty_params . iter ( ) {
140
138
self . check_case ( cx, "type parameter" , gen. name , gen. span ) ;
141
139
}
@@ -229,7 +227,7 @@ impl LintPass for NonSnakeCase {
229
227
}
230
228
231
229
impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for NonSnakeCase {
232
- fn check_crate ( & mut self , cx : & LateContext < ' a , ' tcx > , cr : & ' tcx hir:: Crate ) {
230
+ fn check_crate ( & mut self , cx : & LateContext , cr : & hir:: Crate ) {
233
231
let attr_crate_name = cr. attrs
234
232
. iter ( )
235
233
. find ( |at| at. check_name ( "crate_name" ) )
@@ -242,12 +240,12 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonSnakeCase {
242
240
}
243
241
244
242
fn check_fn ( & mut self ,
245
- cx : & LateContext < ' a , ' tcx > ,
246
- fk : FnKind ,
247
- _: & ' tcx hir:: FnDecl ,
248
- _: & ' tcx hir:: Expr ,
249
- span : Span ,
250
- id : ast:: NodeId ) {
243
+ cx : & LateContext ,
244
+ fk : FnKind ,
245
+ _: & hir:: FnDecl ,
246
+ _: & hir:: Expr ,
247
+ span : Span ,
248
+ id : ast:: NodeId ) {
251
249
match fk {
252
250
FnKind :: Method ( name, ..) => {
253
251
match method_context ( cx, id, span) {
@@ -267,15 +265,13 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonSnakeCase {
267
265
}
268
266
}
269
267
270
- fn check_item ( & mut self , cx : & LateContext < ' a , ' tcx > , it : & ' tcx hir:: Item ) {
268
+ fn check_item ( & mut self , cx : & LateContext , it : & hir:: Item ) {
271
269
if let hir:: ItemMod ( _) = it. node {
272
270
self . check_snake_case ( cx, "module" , & it. name . as_str ( ) , Some ( it. span ) ) ;
273
271
}
274
272
}
275
273
276
- fn check_trait_item ( & mut self ,
277
- cx : & LateContext < ' a , ' tcx > ,
278
- trait_item : & ' tcx hir:: TraitItem ) {
274
+ fn check_trait_item ( & mut self , cx : & LateContext , trait_item : & hir:: TraitItem ) {
279
275
if let hir:: MethodTraitItem ( _, None ) = trait_item. node {
280
276
self . check_snake_case ( cx,
281
277
"trait method" ,
@@ -284,16 +280,14 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonSnakeCase {
284
280
}
285
281
}
286
282
287
- fn check_lifetime_def ( & mut self ,
288
- cx : & LateContext < ' a , ' tcx > ,
289
- t : & ' tcx hir:: LifetimeDef ) {
283
+ fn check_lifetime_def ( & mut self , cx : & LateContext , t : & hir:: LifetimeDef ) {
290
284
self . check_snake_case ( cx,
291
285
"lifetime" ,
292
286
& t. lifetime . name . as_str ( ) ,
293
287
Some ( t. lifetime . span ) ) ;
294
288
}
295
289
296
- fn check_pat ( & mut self , cx : & LateContext < ' a , ' tcx > , p : & ' tcx hir:: Pat ) {
290
+ fn check_pat ( & mut self , cx : & LateContext , p : & hir:: Pat ) {
297
291
// Exclude parameter names from foreign functions
298
292
let parent_node = cx. tcx . map . get_parent_node ( p. id ) ;
299
293
if let hir:: map:: NodeForeignItem ( item) = cx. tcx . map . get ( parent_node) {
@@ -308,11 +302,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonSnakeCase {
308
302
}
309
303
310
304
fn check_struct_def ( & mut self ,
311
- cx : & LateContext < ' a , ' tcx > ,
312
- s : & ' tcx hir:: VariantData ,
313
- _: ast:: Name ,
314
- _: & ' tcx hir:: Generics ,
315
- _: ast:: NodeId ) {
305
+ cx : & LateContext ,
306
+ s : & hir:: VariantData ,
307
+ _: ast:: Name ,
308
+ _: & hir:: Generics ,
309
+ _: ast:: NodeId ) {
316
310
for sf in s. fields ( ) {
317
311
self . check_snake_case ( cx, "structure field" , & sf. name . as_str ( ) , Some ( sf. span ) ) ;
318
312
}
@@ -355,7 +349,7 @@ impl LintPass for NonUpperCaseGlobals {
355
349
}
356
350
357
351
impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for NonUpperCaseGlobals {
358
- fn check_item ( & mut self , cx : & LateContext < ' a , ' tcx > , it : & ' tcx hir:: Item ) {
352
+ fn check_item ( & mut self , cx : & LateContext , it : & hir:: Item ) {
359
353
match it. node {
360
354
hir:: ItemStatic ( ..) => {
361
355
NonUpperCaseGlobals :: check_upper_case ( cx, "static variable" , it. name , it. span ) ;
@@ -367,9 +361,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonUpperCaseGlobals {
367
361
}
368
362
}
369
363
370
- fn check_trait_item ( & mut self ,
371
- cx : & LateContext < ' a , ' tcx > ,
372
- ti : & ' tcx hir:: TraitItem ) {
364
+ fn check_trait_item ( & mut self , cx : & LateContext , ti : & hir:: TraitItem ) {
373
365
match ti. node {
374
366
hir:: ConstTraitItem ( ..) => {
375
367
NonUpperCaseGlobals :: check_upper_case ( cx, "associated constant" , ti. name , ti. span ) ;
@@ -378,9 +370,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonUpperCaseGlobals {
378
370
}
379
371
}
380
372
381
- fn check_impl_item ( & mut self ,
382
- cx : & LateContext < ' a , ' tcx > ,
383
- ii : & ' tcx hir:: ImplItem ) {
373
+ fn check_impl_item ( & mut self , cx : & LateContext , ii : & hir:: ImplItem ) {
384
374
match ii. node {
385
375
hir:: ImplItemKind :: Const ( ..) => {
386
376
NonUpperCaseGlobals :: check_upper_case ( cx, "associated constant" , ii. name , ii. span ) ;
@@ -389,7 +379,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonUpperCaseGlobals {
389
379
}
390
380
}
391
381
392
- fn check_pat ( & mut self , cx : & LateContext < ' a , ' tcx > , p : & ' tcx hir:: Pat ) {
382
+ fn check_pat ( & mut self , cx : & LateContext , p : & hir:: Pat ) {
393
383
// Lint for constants that look like binding identifiers (#7526)
394
384
if let PatKind :: Path ( hir:: QPath :: Resolved ( None , ref path) ) = p. node {
395
385
if !path. global && path. segments . len ( ) == 1 && path. segments [ 0 ] . parameters . is_empty ( ) {
0 commit comments