@@ -164,9 +164,6 @@ crate struct LifetimeContext<'a, 'tcx> {
164164 map : & ' a mut NamedRegionMap ,
165165 scope : ScopeRef < ' a > ,
166166
167- /// Used to disallow the use of in-band lifetimes in `fn` or `Fn` syntax.
168- is_in_fn_syntax : bool ,
169-
170167 is_in_const_generic : bool ,
171168
172169 /// Indicates that we only care about the definition of a trait. This should
@@ -455,7 +452,6 @@ fn do_resolve(
455452 tcx,
456453 map : & mut named_region_map,
457454 scope : ROOT_SCOPE ,
458- is_in_fn_syntax : false ,
459455 is_in_const_generic : false ,
460456 trait_definition_only,
461457 labels_in_fn : vec ! [ ] ,
@@ -874,8 +870,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
874870 match ty. kind {
875871 hir:: TyKind :: BareFn ( ref c) => {
876872 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 ;
879873 let lifetime_span: Option < Span > =
880874 c. generic_params . iter ( ) . rev ( ) . find_map ( |param| match param. kind {
881875 GenericParamKind :: Lifetime { .. } => Some ( param. span ) ,
@@ -917,7 +911,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
917911 intravisit:: walk_ty ( this, ty) ;
918912 } ) ;
919913 self . missing_named_lifetime_spots . pop ( ) ;
920- self . is_in_fn_syntax = was_in_fn_syntax;
921914 }
922915 hir:: TyKind :: TraitObject ( bounds, ref lifetime, _) => {
923916 debug ! ( ?bounds, ?lifetime, "TraitObject" ) ;
@@ -1805,7 +1798,6 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
18051798 tcx : * tcx,
18061799 map,
18071800 scope : & wrap_scope,
1808- is_in_fn_syntax : self . is_in_fn_syntax ,
18091801 is_in_const_generic : self . is_in_const_generic ,
18101802 trait_definition_only : self . trait_definition_only ,
18111803 labels_in_fn,
@@ -2336,10 +2328,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
23362328 ) ;
23372329
23382330 if generic_args. parenthesized {
2339- let was_in_fn_syntax = self . is_in_fn_syntax ;
2340- self . is_in_fn_syntax = true ;
23412331 self . visit_fn_like_elision ( generic_args. inputs ( ) , Some ( generic_args. bindings [ 0 ] . ty ( ) ) ) ;
2342- self . is_in_fn_syntax = was_in_fn_syntax;
23432332 return ;
23442333 }
23452334
0 commit comments