From c6e6ceb078f57519bf246eba791dc20aa007948a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sun, 25 Jun 2023 23:16:00 +0200 Subject: [PATCH] make custom mir ICE a bit nicer --- compiler/rustc_mir_build/src/build/custom/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_mir_build/src/build/custom/mod.rs b/compiler/rustc_mir_build/src/build/custom/mod.rs index 32c618828c9..e5c2cc6c7bb 100644 --- a/compiler/rustc_mir_build/src/build/custom/mod.rs +++ b/compiler/rustc_mir_build/src/build/custom/mod.rs @@ -118,7 +118,11 @@ fn parse_attribute(attr: &Attribute) -> MirPhase { phase = Some(value); } other => { - panic!("Unexpected key {}", other); + span_bug!( + nested.span(), + "Unexpected key while parsing custom_mir attribute: '{}'", + other + ); } } }