Skip to content

Commit

Permalink
Improve 'unknown instrinsic' error message
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Dylan McKay committed Aug 15, 2015
1 parent 30ec363 commit ea7768c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_trans/trans/context.rs
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit ea7768c

Please sign in to comment.