From 95b5d862e0bcb5ea3fa2a44c87cbed0b18781abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sat, 15 Feb 2020 19:29:08 +0100 Subject: [PATCH] clippy-driver: pass all args after "rustc" to rustc --- src/driver.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/driver.rs b/src/driver.rs index 097b796e785b..25ddee71ded2 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -299,6 +299,21 @@ pub fn main() { rustc_driver::catch_fatal_errors(move || { let mut orig_args: Vec = env::args().collect(); + if orig_args.get(1) == Some(&"rustc".into()) { + // first (0) arg is the bin path, second arg is "rustc" + // pass all succeeding args to rustc + let args_for_rustc = &orig_args[2..].to_vec(); + + let exitstatus = Command::new("rustc") + .args(args_for_rustc) + .status() + .unwrap() + .code() + .unwrap(); + + exit(exitstatus); + } + if orig_args.iter().any(|a| a == "--version" || a == "-V") { let version_info = rustc_tools_util::get_version_info!(); println!("{}", version_info);