Skip to content

Commit 552f6b0

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

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
@@ -1919,18 +1919,13 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
19191919

19201920
hir::LifetimeName::Param(param, p_name)
19211921
}
1922-
LifetimeRes::Fresh { param, binder } => {
1922+
LifetimeRes::Fresh { param, .. } => {
19231923
debug_assert_eq!(ident.name, kw::UnderscoreLifetime);
19241924

19251925
let mut param = self.local_def_id(param);
19261926
if let Some(mut captured_lifetimes) = self.captured_lifetimes.take() {
1927-
if !captured_lifetimes.binders_to_ignore.contains(&binder) {
1928-
match captured_lifetimes.captures.entry(param) {
1929-
Entry::Occupied(o) => param = self.local_def_id(o.get().1),
1930-
Entry::Vacant(_) => {
1931-
panic!("Lifetime {:?} should have a def_id at this point", id);
1932-
}
1933-
}
1927+
if let Entry::Occupied(o) = captured_lifetimes.captures.entry(param) {
1928+
param = self.local_def_id(o.get().1);
19341929
}
19351930

19361931
self.captured_lifetimes = Some(captured_lifetimes);

0 commit comments

Comments
 (0)