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