Skip to content

Commit 6041ed0

Browse files
committed
No need to check binders to ignore on new_named_lifetime_with_res's LifetimeRes::Param
1 parent d9e6364 commit 6041ed0

File tree

1 file changed

+3
-8
lines changed
  • compiler/rustc_ast_lowering/src

1 file changed

+3
-8
lines changed

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,16 +1907,11 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
19071907
debug!(?self.captured_lifetimes);
19081908

19091909
let name = match res {
1910-
LifetimeRes::Param { mut param, binder } => {
1910+
LifetimeRes::Param { mut param, .. } => {
19111911
let p_name = ParamName::Plain(ident);
19121912
if let Some(mut captured_lifetimes) = self.captured_lifetimes.take() {
1913-
if !captured_lifetimes.binders_to_ignore.contains(&binder) {
1914-
match captured_lifetimes.captures.entry(param) {
1915-
Entry::Occupied(o) => param = self.local_def_id(o.get().1),
1916-
Entry::Vacant(_) => {
1917-
panic!("Lifetime {:?} should have a def_id at this point", id);
1918-
}
1919-
}
1913+
if let Entry::Occupied(o) = captured_lifetimes.captures.entry(param) {
1914+
param = self.local_def_id(o.get().1);
19201915
}
19211916

19221917
self.captured_lifetimes = Some(captured_lifetimes);

0 commit comments

Comments
 (0)