diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-03-11 12:01:20 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-04-17 11:03:33 +0200 |
| commit | 4cfceeabdcd185cd4bfca080d39e93abddc4977a (patch) | |
| tree | 7b74496d3e226efa12b79ea71bb8fb8a2eaa1494 /compiler | |
| parent | e47f66dc0d2697aab816fe045fb00195bac18596 (diff) | |
| download | rust-4cfceeabdcd185cd4bfca080d39e93abddc4977a.tar.gz rust-4cfceeabdcd185cd4bfca080d39e93abddc4977a.zip | |
Remove is_in_fn_syntax.
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_resolve/src/late/lifetimes.rs | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/compiler/rustc_resolve/src/late/lifetimes.rs b/compiler/rustc_resolve/src/late/lifetimes.rs index 2bf01146fae..1aa1d51e2ef 100644 --- a/compiler/rustc_resolve/src/late/lifetimes.rs +++ b/compiler/rustc_resolve/src/late/lifetimes.rs @@ -164,9 +164,6 @@ crate struct LifetimeContext<'a, 'tcx> { map: &'a mut NamedRegionMap, scope: ScopeRef<'a>, - /// Used to disallow the use of in-band lifetimes in `fn` or `Fn` syntax. - is_in_fn_syntax: bool, - is_in_const_generic: bool, /// Indicates that we only care about the definition of a trait. This should @@ -455,7 +452,6 @@ fn do_resolve( tcx, map: &mut named_region_map, scope: ROOT_SCOPE, - is_in_fn_syntax: false, is_in_const_generic: false, trait_definition_only, labels_in_fn: vec![], @@ -874,8 +870,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { match ty.kind { hir::TyKind::BareFn(ref c) => { let next_early_index = self.next_early_index(); - let was_in_fn_syntax = self.is_in_fn_syntax; - self.is_in_fn_syntax = true; let lifetime_span: Option<Span> = c.generic_params.iter().rev().find_map(|param| match param.kind { GenericParamKind::Lifetime { .. } => Some(param.span), @@ -917,7 +911,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { intravisit::walk_ty(this, ty); }); self.missing_named_lifetime_spots.pop(); - self.is_in_fn_syntax = was_in_fn_syntax; } hir::TyKind::TraitObject(bounds, ref lifetime, _) => { debug!(?bounds, ?lifetime, "TraitObject"); @@ -1805,7 +1798,6 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> { tcx: *tcx, map, scope: &wrap_scope, - is_in_fn_syntax: self.is_in_fn_syntax, is_in_const_generic: self.is_in_const_generic, trait_definition_only: self.trait_definition_only, labels_in_fn, @@ -2336,10 +2328,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> { ); if generic_args.parenthesized { - let was_in_fn_syntax = self.is_in_fn_syntax; - self.is_in_fn_syntax = true; self.visit_fn_like_elision(generic_args.inputs(), Some(generic_args.bindings[0].ty())); - self.is_in_fn_syntax = was_in_fn_syntax; return; } |
