From 52deb3b0863558315b57b801804820254d4eaa4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Thu, 7 Jun 2018 19:16:41 +0200 Subject: [PATCH] Prepare for upcoming breakage --- src/driver.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/driver.rs b/src/driver.rs index a88d6e5c26d..217bcca45de 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -21,14 +21,14 @@ use std::process::Command; use syntax::ast; struct ClippyCompilerCalls { - default: RustcDefaultCalls, + default: Box, run_lints: bool, } impl ClippyCompilerCalls { fn new(run_lints: bool) -> Self { Self { - default: RustcDefaultCalls, + default: Box::new(RustcDefaultCalls), run_lints, } } @@ -69,8 +69,8 @@ impl<'a> CompilerCalls<'a> for ClippyCompilerCalls { self.default .late_callback(trans_crate, matches, sess, crate_stores, input, odir, ofile) } - fn build_controller(&mut self, sess: &Session, matches: &getopts::Matches) -> driver::CompileController<'a> { - let mut control = self.default.build_controller(sess, matches); + fn build_controller(self: Box, sess: &Session, matches: &getopts::Matches) -> driver::CompileController<'a> { + let mut control = self.default.clone().build_controller(sess, matches); if self.run_lints { let old = std::mem::replace(&mut control.after_parse.callback, box |_| {}); @@ -198,6 +198,6 @@ pub fn main() { } } - let mut ccc = ClippyCompilerCalls::new(clippy_enabled); - rustc_driver::run(move || rustc_driver::run_compiler(&args, &mut ccc, None, None)); + let ccc = ClippyCompilerCalls::new(clippy_enabled); + rustc_driver::run(move || rustc_driver::run_compiler(&args, Box::new(ccc), None, None)); }