From 25ca33d1073cfcd53c12f43df4e3a315411bef9d Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sun, 10 Jun 2018 11:47:04 +0200 Subject: [PATCH] Fix rustc_tests --- rustc_tests/src/main.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/rustc_tests/src/main.rs b/rustc_tests/src/main.rs index ecc5287c727..3e2cd032a80 100644 --- a/rustc_tests/src/main.rs +++ b/rustc_tests/src/main.rs @@ -24,7 +24,7 @@ use syntax::ast; struct MiriCompilerCalls { - default: RustcDefaultCalls, + default: Box, /// 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, 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 { -- 2.44.0