Skip to content

Commit

Permalink
clippy-driver: pass all args after "rustc" to rustc
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Feb 15, 2020
1 parent 578960d commit 95b5d86
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,21 @@ pub fn main() {
rustc_driver::catch_fatal_errors(move || {
let mut orig_args: Vec<String> = 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);
Expand Down

0 comments on commit 95b5d86

Please sign in to comment.