No need to check binders to ignore on new_named_lifetime_with_res's LifetimeRes::Param
This commit is contained in:
parent
d9e6364755
commit
6041ed0775
1 changed files with 3 additions and 8 deletions
|
@ -1907,16 +1907,11 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
|||
debug!(?self.captured_lifetimes);
|
||||
|
||||
let name = match res {
|
||||
LifetimeRes::Param { mut param, binder } => {
|
||||
LifetimeRes::Param { mut param, .. } => {
|
||||
let p_name = ParamName::Plain(ident);
|
||||
if let Some(mut captured_lifetimes) = self.captured_lifetimes.take() {
|
||||
if !captured_lifetimes.binders_to_ignore.contains(&binder) {
|
||||
match captured_lifetimes.captures.entry(param) {
|
||||
Entry::Occupied(o) => param = self.local_def_id(o.get().1),
|
||||
Entry::Vacant(_) => {
|
||||
panic!("Lifetime {:?} should have a def_id at this point", id);
|
||||
}
|
||||
}
|
||||
if let Entry::Occupied(o) = captured_lifetimes.captures.entry(param) {
|
||||
param = self.local_def_id(o.get().1);
|
||||
}
|
||||
|
||||
self.captured_lifetimes = Some(captured_lifetimes);
|
||||
|
|
Loading…
Add table
Reference in a new issue