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

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

View File

@ -1932,17 +1932,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
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(kw::UnderscoreLifetime),
);
v.insert((span, p_id, ParamName::Fresh, res));
param = p_def_id;
Entry::Vacant(_) => {
panic!("Lifetime {:?} should have a def_id at this point", id);
}
}
}