Skip to content

Commit 95b5d86

Browse files
committed
clippy-driver: pass all args after "rustc" to rustc
1 parent 578960d commit 95b5d86

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/driver.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,21 @@ pub fn main() {
299299
rustc_driver::catch_fatal_errors(move || {
300300
let mut orig_args: Vec<String> = env::args().collect();
301301

302+
if orig_args.get(1) == Some(&"rustc".into()) {
303+
// first (0) arg is the bin path, second arg is "rustc"
304+
// pass all succeeding args to rustc
305+
let args_for_rustc = &orig_args[2..].to_vec();
306+
307+
let exitstatus = Command::new("rustc")
308+
.args(args_for_rustc)
309+
.status()
310+
.unwrap()
311+
.code()
312+
.unwrap();
313+
314+
exit(exitstatus);
315+
}
316+
302317
if orig_args.iter().any(|a| a == "--version" || a == "-V") {
303318
let version_info = rustc_tools_util::get_version_info!();
304319
println!("{}", version_info);

0 commit comments

Comments
 (0)