-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Followup to #83944 #84377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Followup to #83944 #84377
Changes from 1 commit
ba3d22e
32942ab
457c4c1
9891582
4568e7d
b78c0d8
c78724f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1323,14 +1323,15 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { | |
// of "if there isn't a Binder scope above us, add one", but I | ||
// imagine there's a better way to go about this. | ||
let mut scope = self.scope; | ||
let trait_ref_hack = loop { | ||
let (binders, scope_type) = loop { | ||
match scope { | ||
Scope::TraitRefBoundary { .. } | Scope::Body { .. } | Scope::Root => { | ||
break false; | ||
break (vec![], BinderScopeType::PolyTraitRef); | ||
} | ||
|
||
Scope::Binder { .. } => { | ||
break true; | ||
Scope::Binder { hir_id, .. } => { | ||
let binders = self.map.late_bound_vars.entry(*hir_id).or_default().clone(); | ||
break (binders, BinderScopeType::Concatenating); | ||
} | ||
|
||
Scope::Elision { s, .. } | ||
|
@@ -1341,16 +1342,16 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { | |
} | ||
}; | ||
match bound { | ||
hir::GenericBound::LangItemTrait(_, _, hir_id, _) if !trait_ref_hack => { | ||
self.map.late_bound_vars.insert(*hir_id, vec![]); | ||
hir::GenericBound::LangItemTrait(_, _, hir_id, _) => { | ||
self.map.late_bound_vars.insert(*hir_id, binders); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Except that I don't quite get why we need any code here at all. It seems like the I guess the only change could be that there is a |
||
let scope = Scope::Binder { | ||
hir_id: *hir_id, | ||
lifetimes: FxHashMap::default(), | ||
s: self.scope, | ||
next_early_index: self.next_early_index(), | ||
track_lifetime_uses: true, | ||
opaque_type_parent: false, | ||
scope_type: BinderScopeType::Other, | ||
scope_type, | ||
}; | ||
self.with(scope, |_, this| { | ||
intravisit::walk_param_bound(this, bound); | ||
|
Uh oh!
There was an error while loading. Please reload this page.