new_named_lifetime_with_res's LifetimeRes::Param should have created def_id already

This commit is contained in:
Santiago Pastorino 2022-08-02 15:14:42 -03:00
parent 14ea17858d
commit 3030ab3074
No known key found for this signature in database
GPG Key ID: 8131A24E0C79EFAF

View File

@ -1913,17 +1913,8 @@ fn new_named_lifetime_with_res(
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(v) => {
let p_id = self.next_node_id();
let p_def_id = self.create_def(
captured_lifetimes.parent_def_id,
p_id,
DefPathData::LifetimeNs(p_name.ident().name),
);
v.insert((span, p_id, p_name, res));
param = p_def_id;
Entry::Vacant(_) => {
panic!("Lifetime {:?} should have a def_id at this point", id);
}
}
}