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.
This commit is contained in:
Dylan McKay 2015-08-15 21:06:06 +12:00
parent 30ec363c76
commit ea7768c2dd

View File

@ -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)
}
}