@@ -112,9 +112,9 @@ enum RefLt {
112
112
113
113
fn check_fn_inner < ' a , ' tcx > (
114
114
cx : & LateContext < ' a , ' tcx > ,
115
- decl : & ' tcx FnDecl ,
115
+ decl : & ' tcx FnDecl < ' _ > ,
116
116
body : Option < BodyId > ,
117
- generics : & ' tcx Generics ,
117
+ generics : & ' tcx Generics < ' _ > ,
118
118
span : Span ,
119
119
report_extra_lifetimes : bool ,
120
120
) {
@@ -128,7 +128,7 @@ fn check_fn_inner<'a, 'tcx>(
128
128
_ => false ,
129
129
} ) ;
130
130
for typ in types {
131
- for bound in & typ. bounds {
131
+ for bound in typ. bounds {
132
132
let mut visitor = RefVisitor :: new ( cx) ;
133
133
walk_param_bound ( & mut visitor, bound) ;
134
134
if visitor. lts . iter ( ) . any ( |lt| matches ! ( lt, RefLt :: Named ( _) ) ) {
@@ -173,9 +173,9 @@ fn check_fn_inner<'a, 'tcx>(
173
173
174
174
fn could_use_elision < ' a , ' tcx > (
175
175
cx : & LateContext < ' a , ' tcx > ,
176
- func : & ' tcx FnDecl ,
176
+ func : & ' tcx FnDecl < ' _ > ,
177
177
body : Option < BodyId > ,
178
- named_generics : & ' tcx [ GenericParam ] ,
178
+ named_generics : & ' tcx [ GenericParam < ' _ > ] ,
179
179
bounds_lts : Vec < & ' tcx Lifetime > ,
180
180
) -> bool {
181
181
// There are two scenarios where elision works:
@@ -192,7 +192,7 @@ fn could_use_elision<'a, 'tcx>(
192
192
let mut output_visitor = RefVisitor :: new ( cx) ;
193
193
194
194
// extract lifetimes in input argument types
195
- for arg in & func. inputs {
195
+ for arg in func. inputs {
196
196
input_visitor. visit_ty ( arg) ;
197
197
}
198
198
// extract lifetimes in output type
@@ -258,7 +258,7 @@ fn could_use_elision<'a, 'tcx>(
258
258
}
259
259
}
260
260
261
- fn allowed_lts_from ( named_generics : & [ GenericParam ] ) -> FxHashSet < RefLt > {
261
+ fn allowed_lts_from ( named_generics : & [ GenericParam < ' _ > ] ) -> FxHashSet < RefLt > {
262
262
let mut allowed_lts = FxHashSet :: default ( ) ;
263
263
for par in named_generics. iter ( ) {
264
264
if let GenericParamKind :: Lifetime { .. } = par. kind {
@@ -328,7 +328,7 @@ impl<'v, 't> RefVisitor<'v, 't> {
328
328
}
329
329
}
330
330
331
- fn collect_anonymous_lifetimes ( & mut self , qpath : & QPath , ty : & Ty ) {
331
+ fn collect_anonymous_lifetimes ( & mut self , qpath : & QPath < ' _ > , ty : & Ty < ' _ > ) {
332
332
if let Some ( ref last_path_segment) = last_path_segment ( qpath) . args {
333
333
if !last_path_segment. parenthesized
334
334
&& !last_path_segment. args . iter ( ) . any ( |arg| match arg {
@@ -363,7 +363,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
363
363
self . record ( & Some ( * lifetime) ) ;
364
364
}
365
365
366
- fn visit_ty ( & mut self , ty : & ' tcx Ty ) {
366
+ fn visit_ty ( & mut self , ty : & ' tcx Ty < ' _ > ) {
367
367
match ty. kind {
368
368
TyKind :: Rptr ( ref lt, _) if lt. is_elided ( ) => {
369
369
self . record ( & None ) ;
@@ -374,7 +374,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
374
374
TyKind :: Def ( item, _) => {
375
375
let map = self . cx . tcx . hir ( ) ;
376
376
if let ItemKind :: OpaqueTy ( ref exist_ty) = map. expect_item ( item. id ) . kind {
377
- for bound in & exist_ty. bounds {
377
+ for bound in exist_ty. bounds {
378
378
if let GenericBound :: Outlives ( _) = * bound {
379
379
self . record ( & None ) ;
380
380
}
@@ -384,7 +384,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
384
384
}
385
385
walk_ty ( self , ty) ;
386
386
} ,
387
- TyKind :: TraitObject ( ref bounds, ref lt) => {
387
+ TyKind :: TraitObject ( bounds, ref lt) => {
388
388
if !lt. is_elided ( ) {
389
389
self . abort = true ;
390
390
}
@@ -404,8 +404,8 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
404
404
405
405
/// Are any lifetimes mentioned in the `where` clause? If so, we don't try to
406
406
/// reason about elision.
407
- fn has_where_lifetimes < ' a , ' tcx > ( cx : & LateContext < ' a , ' tcx > , where_clause : & ' tcx WhereClause ) -> bool {
408
- for predicate in & where_clause. predicates {
407
+ fn has_where_lifetimes < ' a , ' tcx > ( cx : & LateContext < ' a , ' tcx > , where_clause : & ' tcx WhereClause < ' _ > ) -> bool {
408
+ for predicate in where_clause. predicates {
409
409
match * predicate {
410
410
WherePredicate :: RegionPredicate ( ..) => return true ,
411
411
WherePredicate :: BoundPredicate ( ref pred) => {
@@ -457,7 +457,7 @@ impl<'tcx> Visitor<'tcx> for LifetimeChecker {
457
457
self . map . remove ( & lifetime. name . ident ( ) . name ) ;
458
458
}
459
459
460
- fn visit_generic_param ( & mut self , param : & ' tcx GenericParam ) {
460
+ fn visit_generic_param ( & mut self , param : & ' tcx GenericParam < ' _ > ) {
461
461
// don't actually visit `<'a>` or `<'a: 'b>`
462
462
// we've already visited the `'a` declarations and
463
463
// don't want to spuriously remove them
@@ -472,7 +472,7 @@ impl<'tcx> Visitor<'tcx> for LifetimeChecker {
472
472
}
473
473
}
474
474
475
- fn report_extra_lifetimes < ' a , ' tcx > ( cx : & LateContext < ' a , ' tcx > , func : & ' tcx FnDecl , generics : & ' tcx Generics ) {
475
+ fn report_extra_lifetimes < ' a , ' tcx > ( cx : & LateContext < ' a , ' tcx > , func : & ' tcx FnDecl < ' _ > , generics : & ' tcx Generics < ' _ > ) {
476
476
let hs = generics
477
477
. params
478
478
. iter ( )
0 commit comments