diff options
| author | Michael Goulet <michael@errs.io> | 2024-11-09 22:15:01 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-11-10 04:30:33 +0000 |
| commit | 58abbaf077b32920f7a01723c2b50647d7b2dce0 (patch) | |
| tree | e08b52ffce9bf9384951b4a8dfadb957da367e5c /compiler/rustc_hir_analysis/src | |
| parent | b73478b6ee1ed915ac3727da02d4675835588538 (diff) | |
| download | rust-58abbaf077b32920f7a01723c2b50647d7b2dce0.tar.gz rust-58abbaf077b32920f7a01723c2b50647d7b2dce0.zip | |
Revert "Skip late-bound lifetimes when crossing an AnonConst."
This reverts commit a7f609504c92c9912b61025ae26a5404d3ee4311.
Diffstat (limited to 'compiler/rustc_hir_analysis/src')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs b/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs index cc55f57c46c..2ec12a2d2d3 100644 --- a/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs +++ b/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs @@ -573,17 +573,11 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> { // give, we will reverse the IndexMap after early captures. let mut late_depth = 0; let mut scope = self.scope; - let mut crossed_late_boundary = None; let mut opaque_capture_scopes = vec![(opaque.def_id, &captures)]; loop { match *scope { Scope::Binder { ref bound_vars, scope_type, s, .. } => { for (&original_lifetime, &def) in bound_vars.iter().rev() { - if let ResolvedArg::LateBound(..) = def - && crossed_late_boundary.is_some() - { - continue; - } if let DefKind::LifetimeParam = self.tcx.def_kind(original_lifetime) { let def = def.shifted(late_depth); let ident = lifetime_ident(original_lifetime); @@ -624,12 +618,8 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> { Scope::ObjectLifetimeDefault { s, .. } | Scope::Supertrait { s, .. } - | Scope::TraitRefBoundary { s, .. } => { - scope = s; - } - - Scope::LateBoundary { s, what, .. } => { - crossed_late_boundary = Some(what); + | Scope::TraitRefBoundary { s, .. } + | Scope::LateBoundary { s, .. } => { scope = s; } } |
