@@ -164,9 +164,6 @@ crate struct LifetimeContext<'a, 'tcx> {
164
164
map : & ' a mut NamedRegionMap ,
165
165
scope : ScopeRef < ' a > ,
166
166
167
- /// Used to disallow the use of in-band lifetimes in `fn` or `Fn` syntax.
168
- is_in_fn_syntax : bool ,
169
-
170
167
is_in_const_generic : bool ,
171
168
172
169
/// Indicates that we only care about the definition of a trait. This should
@@ -455,7 +452,6 @@ fn do_resolve(
455
452
tcx,
456
453
map : & mut named_region_map,
457
454
scope : ROOT_SCOPE ,
458
- is_in_fn_syntax : false ,
459
455
is_in_const_generic : false ,
460
456
trait_definition_only,
461
457
labels_in_fn : vec ! [ ] ,
@@ -874,8 +870,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
874
870
match ty. kind {
875
871
hir:: TyKind :: BareFn ( ref c) => {
876
872
let next_early_index = self . next_early_index ( ) ;
877
- let was_in_fn_syntax = self . is_in_fn_syntax ;
878
- self . is_in_fn_syntax = true ;
879
873
let lifetime_span: Option < Span > =
880
874
c. generic_params . iter ( ) . rev ( ) . find_map ( |param| match param. kind {
881
875
GenericParamKind :: Lifetime { .. } => Some ( param. span ) ,
@@ -917,7 +911,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
917
911
intravisit:: walk_ty ( this, ty) ;
918
912
} ) ;
919
913
self . missing_named_lifetime_spots . pop ( ) ;
920
- self . is_in_fn_syntax = was_in_fn_syntax;
921
914
}
922
915
hir:: TyKind :: TraitObject ( bounds, ref lifetime, _) => {
923
916
debug ! ( ?bounds, ?lifetime, "TraitObject" ) ;
@@ -1805,7 +1798,6 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
1805
1798
tcx : * tcx,
1806
1799
map,
1807
1800
scope : & wrap_scope,
1808
- is_in_fn_syntax : self . is_in_fn_syntax ,
1809
1801
is_in_const_generic : self . is_in_const_generic ,
1810
1802
trait_definition_only : self . trait_definition_only ,
1811
1803
labels_in_fn,
@@ -2336,10 +2328,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
2336
2328
) ;
2337
2329
2338
2330
if generic_args. parenthesized {
2339
- let was_in_fn_syntax = self . is_in_fn_syntax ;
2340
- self . is_in_fn_syntax = true ;
2341
2331
self . visit_fn_like_elision ( generic_args. inputs ( ) , Some ( generic_args. bindings [ 0 ] . ty ( ) ) ) ;
2342
- self . is_in_fn_syntax = was_in_fn_syntax;
2343
2332
return ;
2344
2333
}
2345
2334
0 commit comments