mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 05:57:03 +03:00
Fix rustc_tests
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
use syntax::ast;
|
||||
|
||||
struct MiriCompilerCalls {
|
||||
default: RustcDefaultCalls,
|
||||
default: Box<RustcDefaultCalls>,
|
||||
/// whether we are building for the host
|
||||
host_target: bool,
|
||||
}
|
||||
@@ -63,11 +63,12 @@ fn late_callback(
|
||||
) -> Compilation {
|
||||
self.default.late_callback(trans, matches, sess, cstore, input, odir, ofile)
|
||||
}
|
||||
fn build_controller(&mut self, sess: &Session, matches: &getopts::Matches) -> CompileController<'a> {
|
||||
let mut control = self.default.build_controller(sess, matches);
|
||||
fn build_controller(self: Box<Self>, sess: &Session, matches: &getopts::Matches) -> CompileController<'a> {
|
||||
let this = *self;
|
||||
let mut control = this.default.build_controller(sess, matches);
|
||||
control.after_hir_lowering.callback = Box::new(after_hir_lowering);
|
||||
control.after_analysis.callback = Box::new(after_analysis);
|
||||
if !self.host_target {
|
||||
if !this.host_target {
|
||||
// only fully compile targets on the host
|
||||
control.after_analysis.stop = Compilation::Stop;
|
||||
}
|
||||
@@ -182,10 +183,10 @@ fn flush(&mut self) -> io::Result<()> {
|
||||
let buf = BufWriter::default();
|
||||
let output = buf.clone();
|
||||
let result = std::panic::catch_unwind(|| {
|
||||
rustc_driver::run_compiler(&args, &mut MiriCompilerCalls {
|
||||
default: RustcDefaultCalls,
|
||||
rustc_driver::run_compiler(&args, Box::new(MiriCompilerCalls {
|
||||
default: Box::new(RustcDefaultCalls),
|
||||
host_target,
|
||||
}, None, Some(Box::new(buf)));
|
||||
}), None, Some(Box::new(buf)));
|
||||
});
|
||||
|
||||
match result {
|
||||
|
||||
Reference in New Issue
Block a user