Merge pull request #3136 from mikerite/driver-rustc-arg-2

driver: Improve check for rustc arg
This commit is contained in:
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer 2018-09-06 09:26:11 +02:00 committed by GitHub
commit 3262f9283f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -6,6 +6,7 @@
use rustc_driver::{self, driver::CompileController, Compilation};
use rustc_plugin;
use std::path::Path;
use std::process::{exit, Command};
#[allow(clippy::print_stdout)]
@ -47,7 +48,7 @@ pub fn main() {
if orig_args.len() <= 1 {
std::process::exit(1);
}
if orig_args[1] == "rustc" {
if Path::new(&orig_args[1]).file_stem() == Some("rustc".as_ref()) {
// we still want to be able to invoke it normally though
orig_args.remove(1);
}