@@ -18,7 +18,7 @@ pub enum MethodLateContext {
1818 PlainImpl ,
1919}
2020
21- pub fn method_context ( cx : & LateContext < ' _ , ' _ > , id : hir:: HirId ) -> MethodLateContext {
21+ pub fn method_context ( cx : & LateContext < ' _ > , id : hir:: HirId ) -> MethodLateContext {
2222 let def_id = cx. tcx . hir ( ) . local_def_id ( id) ;
2323 let item = cx. tcx . associated_item ( def_id) ;
2424 match item. container {
@@ -200,7 +200,7 @@ impl NonSnakeCase {
200200 }
201201
202202 /// Checks if a given identifier is snake case, and reports a diagnostic if not.
203- fn check_snake_case ( & self , cx : & LateContext < ' _ , ' _ > , sort : & str , ident : & Ident ) {
203+ fn check_snake_case ( & self , cx : & LateContext < ' _ > , sort : & str , ident : & Ident ) {
204204 fn is_snake_case ( ident : & str ) -> bool {
205205 if ident. is_empty ( ) {
206206 return true ;
@@ -248,10 +248,10 @@ impl NonSnakeCase {
248248 }
249249}
250250
251- impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for NonSnakeCase {
251+ impl < ' tcx > LateLintPass < ' tcx > for NonSnakeCase {
252252 fn check_mod (
253253 & mut self ,
254- cx : & LateContext < ' _ , ' _ > ,
254+ cx : & LateContext < ' _ > ,
255255 _: & ' tcx hir:: Mod < ' tcx > ,
256256 _: Span ,
257257 id : hir:: HirId ,
@@ -300,15 +300,15 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonSnakeCase {
300300 }
301301 }
302302
303- fn check_generic_param ( & mut self , cx : & LateContext < ' _ , ' _ > , param : & hir:: GenericParam < ' _ > ) {
303+ fn check_generic_param ( & mut self , cx : & LateContext < ' _ > , param : & hir:: GenericParam < ' _ > ) {
304304 if let GenericParamKind :: Lifetime { .. } = param. kind {
305305 self . check_snake_case ( cx, "lifetime" , & param. name . ident ( ) ) ;
306306 }
307307 }
308308
309309 fn check_fn (
310310 & mut self ,
311- cx : & LateContext < ' _ , ' _ > ,
311+ cx : & LateContext < ' _ > ,
312312 fk : FnKind < ' _ > ,
313313 _: & hir:: FnDecl < ' _ > ,
314314 _: & hir:: Body < ' _ > ,
@@ -336,13 +336,13 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonSnakeCase {
336336 }
337337 }
338338
339- fn check_item ( & mut self , cx : & LateContext < ' _ , ' _ > , it : & hir:: Item < ' _ > ) {
339+ fn check_item ( & mut self , cx : & LateContext < ' _ > , it : & hir:: Item < ' _ > ) {
340340 if let hir:: ItemKind :: Mod ( _) = it. kind {
341341 self . check_snake_case ( cx, "module" , & it. ident ) ;
342342 }
343343 }
344344
345- fn check_trait_item ( & mut self , cx : & LateContext < ' _ , ' _ > , item : & hir:: TraitItem < ' _ > ) {
345+ fn check_trait_item ( & mut self , cx : & LateContext < ' _ > , item : & hir:: TraitItem < ' _ > ) {
346346 if let hir:: TraitItemKind :: Fn ( _, hir:: TraitFn :: Required ( pnames) ) = item. kind {
347347 self . check_snake_case ( cx, "trait method" , & item. ident ) ;
348348 for param_name in pnames {
@@ -351,7 +351,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonSnakeCase {
351351 }
352352 }
353353
354- fn check_pat ( & mut self , cx : & LateContext < ' _ , ' _ > , p : & hir:: Pat < ' _ > ) {
354+ fn check_pat ( & mut self , cx : & LateContext < ' _ > , p : & hir:: Pat < ' _ > ) {
355355 if let & PatKind :: Binding ( _, hid, ident, _) = & p. kind {
356356 if let hir:: Node :: Pat ( parent_pat) = cx. tcx . hir ( ) . get ( cx. tcx . hir ( ) . get_parent_node ( hid) )
357357 {
@@ -370,7 +370,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonSnakeCase {
370370 }
371371 }
372372
373- fn check_struct_def ( & mut self , cx : & LateContext < ' _ , ' _ > , s : & hir:: VariantData < ' _ > ) {
373+ fn check_struct_def ( & mut self , cx : & LateContext < ' _ > , s : & hir:: VariantData < ' _ > ) {
374374 for sf in s. fields ( ) {
375375 self . check_snake_case ( cx, "structure field" , & sf. ident ) ;
376376 }
@@ -386,7 +386,7 @@ declare_lint! {
386386declare_lint_pass ! ( NonUpperCaseGlobals => [ NON_UPPER_CASE_GLOBALS ] ) ;
387387
388388impl NonUpperCaseGlobals {
389- fn check_upper_case ( cx : & LateContext < ' _ , ' _ > , sort : & str , ident : & Ident ) {
389+ fn check_upper_case ( cx : & LateContext < ' _ > , sort : & str , ident : & Ident ) {
390390 let name = & ident. name . as_str ( ) ;
391391 if name. chars ( ) . any ( |c| c. is_lowercase ( ) ) {
392392 cx. struct_span_lint ( NON_UPPER_CASE_GLOBALS , ident. span , |lint| {
@@ -404,8 +404,8 @@ impl NonUpperCaseGlobals {
404404 }
405405}
406406
407- impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for NonUpperCaseGlobals {
408- fn check_item ( & mut self , cx : & LateContext < ' _ , ' _ > , it : & hir:: Item < ' _ > ) {
407+ impl < ' tcx > LateLintPass < ' tcx > for NonUpperCaseGlobals {
408+ fn check_item ( & mut self , cx : & LateContext < ' _ > , it : & hir:: Item < ' _ > ) {
409409 match it. kind {
410410 hir:: ItemKind :: Static ( ..) if !attr:: contains_name ( & it. attrs , sym:: no_mangle) => {
411411 NonUpperCaseGlobals :: check_upper_case ( cx, "static variable" , & it. ident ) ;
@@ -417,19 +417,19 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonUpperCaseGlobals {
417417 }
418418 }
419419
420- fn check_trait_item ( & mut self , cx : & LateContext < ' _ , ' _ > , ti : & hir:: TraitItem < ' _ > ) {
420+ fn check_trait_item ( & mut self , cx : & LateContext < ' _ > , ti : & hir:: TraitItem < ' _ > ) {
421421 if let hir:: TraitItemKind :: Const ( ..) = ti. kind {
422422 NonUpperCaseGlobals :: check_upper_case ( cx, "associated constant" , & ti. ident ) ;
423423 }
424424 }
425425
426- fn check_impl_item ( & mut self , cx : & LateContext < ' _ , ' _ > , ii : & hir:: ImplItem < ' _ > ) {
426+ fn check_impl_item ( & mut self , cx : & LateContext < ' _ > , ii : & hir:: ImplItem < ' _ > ) {
427427 if let hir:: ImplItemKind :: Const ( ..) = ii. kind {
428428 NonUpperCaseGlobals :: check_upper_case ( cx, "associated constant" , & ii. ident ) ;
429429 }
430430 }
431431
432- fn check_pat ( & mut self , cx : & LateContext < ' _ , ' _ > , p : & hir:: Pat < ' _ > ) {
432+ fn check_pat ( & mut self , cx : & LateContext < ' _ > , p : & hir:: Pat < ' _ > ) {
433433 // Lint for constants that look like binding identifiers (#7526)
434434 if let PatKind :: Path ( hir:: QPath :: Resolved ( None , ref path) ) = p. kind {
435435 if let Res :: Def ( DefKind :: Const , _) = path. res {
@@ -444,7 +444,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonUpperCaseGlobals {
444444 }
445445 }
446446
447- fn check_generic_param ( & mut self , cx : & LateContext < ' _ , ' _ > , param : & hir:: GenericParam < ' _ > ) {
447+ fn check_generic_param ( & mut self , cx : & LateContext < ' _ > , param : & hir:: GenericParam < ' _ > ) {
448448 if let GenericParamKind :: Const { .. } = param. kind {
449449 NonUpperCaseGlobals :: check_upper_case ( cx, "const parameter" , & param. name . ident ( ) ) ;
450450 }
0 commit comments