]> git.lizzy.rs Git - rust.git/commitdiff
Improve 'unknown instrinsic' error message
authorDylan McKay <dylanmckay34@gmail.com>
Sat, 15 Aug 2015 09:06:06 +0000 (21:06 +1200)
committerDylan McKay <dylanmckay34@gmail.com>
Sat, 15 Aug 2015 09:06:06 +0000 (21:06 +1200)
If you had previously tried to get the ValueRef associated with an
intrinsic that hadn't been described in
`trans::context::declare_intrinsic()`, the compile would panic with
an empty message.

Now we print out details about the error in the panic message.

src/librustc_trans/trans/context.rs

index bd13667ac082482d4b87cb7e459b084427b3d6f4..7f383f568a08781db8281dc92e5fc0b5fafa0bd0 100644 (file)
@@ -566,7 +566,7 @@ pub fn get_intrinsic(&self, key: &str) -> ValueRef {
         }
         match declare_intrinsic(self, key) {
             Some(v) => return v,
-            None => panic!()
+            None => panic!("unknown intrinsic '{}'", key)
         }
     }