From d8c5152f309abe6dc220ea36744ac3698d4187e0 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Thu, 28 Jun 2018 20:13:51 +0200 Subject: [PATCH] Nicer verifier errors --- src/base.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/base.rs b/src/base.rs index e49bb4ba8c5..4546d23225e 100644 --- a/src/base.rs +++ b/src/base.rs @@ -60,7 +60,8 @@ pub fn trans_crate<'a, 'tcx: 'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>) -> Box { match ::cretonne::codegen::verify_function(&f, &flags) { Ok(_) => {} Err(err) => { - tcx.sess.fatal(&format!("cretonne verify error: {}", err)); + let pretty_error = ::cretonne::codegen::print_errors::pretty_verifier_error(&f, None, &err); + tcx.sess.fatal(&format!("cretonne verify error:\n{}", pretty_error)); } } @@ -375,8 +376,8 @@ fn trans_stmt<'a, 'tcx: 'a>(fx: &mut FunctionCx<'a, 'tcx>, stmt: &Statement<'tcx } _ => unimplemented!("checked bin op {:?} for {:?}", bin_op, ty), }; - lval.write_cvalue(fx, res); unimplemented!("checked bin op {:?}", bin_op); + lval.write_cvalue(fx, res); } Rvalue::UnaryOp(un_op, operand) => { let ty = fx.monomorphize(&operand.ty(&fx.mir.local_decls, fx.tcx));