rustc: Convert a fail! to a useful error message.

This commit is contained in:
Huon Wilson 2013-06-08 01:46:49 +10:00
parent 0d0c004b81
commit bc81d279fa

View File

@ -242,7 +242,7 @@ pub enum const_val {
pub fn eval_const_expr(tcx: middle::ty::ctxt, e: @expr) -> const_val {
match eval_const_expr_partial(tcx, e) {
Ok(ref r) => (/*bad*/copy *r),
Err(ref s) => fail!(/*bad*/copy *s)
Err(ref s) => tcx.sess.span_fatal(e.span, *s)
}
}