]> git.lizzy.rs Git - rust.git/commitdiff
Nicer verifier errors
authorbjorn3 <bjorn3@users.noreply.github.com>
Thu, 28 Jun 2018 18:13:51 +0000 (20:13 +0200)
committerbjorn3 <bjorn3@users.noreply.github.com>
Thu, 28 Jun 2018 18:13:51 +0000 (20:13 +0200)
src/base.rs

index e49bb4ba8c54ad7e9b2c24fb1284262da53453a2..4546d23225e89237c33833273af785da0285a436 100644 (file)
@@ -60,7 +60,8 @@ pub fn trans_crate<'a, 'tcx: 'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>) -> Box<Any> {
                         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));