Skip to content

Commit 3030ab3

Browse files
committed
new_named_lifetime_with_res's LifetimeRes::Param should have created def_id already
1 parent 14ea178 commit 3030ab3

File tree

1 file changed

+2
-11
lines changed
  • compiler/rustc_ast_lowering/src

1 file changed

+2
-11
lines changed

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,17 +1913,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
19131913
if !captured_lifetimes.binders_to_ignore.contains(&binder) {
19141914
match captured_lifetimes.captures.entry(param) {
19151915
Entry::Occupied(o) => param = self.local_def_id(o.get().1),
1916-
Entry::Vacant(v) => {
1917-
let p_id = self.next_node_id();
1918-
1919-
let p_def_id = self.create_def(
1920-
captured_lifetimes.parent_def_id,
1921-
p_id,
1922-
DefPathData::LifetimeNs(p_name.ident().name),
1923-
);
1924-
1925-
v.insert((span, p_id, p_name, res));
1926-
param = p_def_id;
1916+
Entry::Vacant(_) => {
1917+
panic!("Lifetime {:?} should have a def_id at this point", id);
19271918
}
19281919
}
19291920
}

0 commit comments

Comments
 (0)