From 6496d6943fbf152d54149797558dccb87434de31 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 17 Mar 2025 15:44:43 +1100 Subject: [PATCH] Make the `match` in `new_named_lifetime` exhaustive. --- compiler/rustc_ast_lowering/src/lib.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 8997e4f11940..e24b45c5b194 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -1789,10 +1789,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { LifetimeRes::Infer => hir::LifetimeName::Infer, LifetimeRes::Static { .. } => hir::LifetimeName::Static, LifetimeRes::Error => hir::LifetimeName::Error, - res => panic!( - "Unexpected lifetime resolution {:?} for {:?} at {:?}", - res, ident, ident.span - ), + LifetimeRes::ElidedAnchor { .. } => { + panic!("Unexpected `ElidedAnchar` {:?} at {:?}", ident, ident.span); + } }; debug!(?res);