diff --git a/compiler/rustc_mir_build/src/build/custom/mod.rs b/compiler/rustc_mir_build/src/build/custom/mod.rs index 32c618828c9b2..e5c2cc6c7bbce 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 + ); } } }