about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-06-25 23:16:00 +0200
committerMatthias Krüger <matthias.krueger@famsik.de>2023-06-26 19:23:22 +0200
commitc6e6ceb078f57519bf246eba791dc20aa007948a (patch)
tree29541635065924024d9ab05732ba60e7dc195537
parent0d03812e2424b324d067d89852ad925d2eecb53e (diff)
downloadrust-c6e6ceb078f57519bf246eba791dc20aa007948a.tar.gz
rust-c6e6ceb078f57519bf246eba791dc20aa007948a.zip
make custom mir ICE a bit nicer
-rw-r--r--compiler/rustc_mir_build/src/build/custom/mod.rs6
1 files changed, 5 insertions, 1 deletions
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
+                );
             }
         }
     }