diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 28b1527ca5f..163c84ae57b 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -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); } } }