diff --git a/build.sh b/build.sh index 09389c6530f..a4a37c54373 100755 --- a/build.sh +++ b/build.sh @@ -17,7 +17,7 @@ RUSTC="rustc -Zcodegen-backend=$(pwd)/../target/debug/librustc_codegen_cranelift $RUSTC mini_core.rs --crate-name mini_core && $RUSTC example.rs && $RUSTC mini_core_hello_world.rs && -$RUSTC ../target/libcore/src/libcore/lib.rs 2>&1 | (head -n 10; echo "===="; tail -n 1000) || -(rm *.rlib; exit 1) -rm *.rlib +$RUSTC ../target/libcore/src/libcore/lib.rs 2>&1 | (head -n 10; echo "===="; tail -n 1000) +cat ../target/log.txt | sort | uniq -c | grep -v "rval unsize move" | grep -v "rval len" +rm *.rlib ../target/log.txt diff --git a/src/lib.rs b/src/lib.rs index b55497394a6..f09f62ca048 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -242,12 +242,15 @@ impl CodegenBackend for CraneliftCodegenBackend { let mut context = Context::new(); { + use std::io::Write; let mut cx = CodegenCx { tcx, module: &mut module, constants: HashMap::new(), }; + let mut log = ::std::fs::File::create("../target/log.txt").unwrap(); + for mono_item in collector::collect_crate_mono_items(tcx, collector::MonoItemCollectionMode::Eager).0 { @@ -258,7 +261,10 @@ impl CodegenBackend for CraneliftCodegenBackend { })); if let Err(err) = res { match err.downcast::() { - Ok(non_fatal) => tcx.sess.err(&non_fatal.0), + Ok(non_fatal) => { + writeln!(log, "{}", &non_fatal.0); + tcx.sess.err(&non_fatal.0) + } Err(err) => ::std::panic::resume_unwind(err), } }