From ea7768c2dd8089cc3c3dc1e27158cf1bed277308 Mon Sep 17 00:00:00 2001 From: Dylan McKay Date: Sat, 15 Aug 2015 21:06:06 +1200 Subject: [PATCH] Improve 'unknown instrinsic' error message 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_trans/trans/context.rs b/src/librustc_trans/trans/context.rs index bd13667ac082..7f383f568a08 100644 --- a/src/librustc_trans/trans/context.rs +++ b/src/librustc_trans/trans/context.rs @@ -566,7 +566,7 @@ impl<'b, 'tcx> CrateContext<'b, 'tcx> { } match declare_intrinsic(self, key) { Some(v) => return v, - None => panic!() + None => panic!("unknown intrinsic '{}'", key) } }