Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions crates/rustc_plugin/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,6 @@ pub fn driver_main<T: RustcPlugin>(plugin: T) -> ExitCode {

let (have_sys_root_arg, sys_root) = get_sysroot(&orig_args);

if orig_args.iter().any(|a| a == "--version" || a == "-V") {
let version_info = rustc_tools_util::get_version_info!();
println!("{version_info}");
exit(0);
}

// Setting RUSTC_WRAPPER causes Cargo to pass 'rustc' as the first argument.
// We're invoking the compiler programmatically, so we ignore this
let wrapper_mode =
Expand All @@ -122,6 +116,10 @@ pub fn driver_main<T: RustcPlugin>(plugin: T) -> ExitCode {
if wrapper_mode {
// we still want to be able to invoke it normally though
orig_args.remove(1);
} else if orig_args.iter().any(|a| a == "--version" || a == "-V") {
let version_info = rustc_tools_util::get_version_info!();
println!("{version_info}");
exit(0);
}

// this conditional check for the --sysroot flag is there so users can call
Expand Down
Loading