mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 17:53:56 +00:00
Add a log for unimplemented stuff
This commit is contained in:
parent
48701d758d
commit
a45f0ee6e3
6
build.sh
6
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
|
||||
|
@ -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::<NonFatal>() {
|
||||
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),
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user