File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 16
16
//! never get replaced.
17
17
18
18
use std:: env;
19
- use std:: path:: PathBuf ;
19
+ use std:: path:: { Path , PathBuf } ;
20
20
use std:: process:: { Child , Command } ;
21
21
use std:: time:: Instant ;
22
22
@@ -85,7 +85,10 @@ fn main() {
85
85
} else {
86
86
// Cargo doesn't respect RUSTC_WRAPPER for version information >:(
87
87
// don't remove the first arg if we're being run as RUSTC instead of RUSTC_WRAPPER.
88
- if args[ 0 ] == env:: current_exe ( ) . expect ( "couldn't get path to rustc shim" ) {
88
+ // Cargo also sometimes doesn't pass the `.exe` suffix on Windows - add it manually.
89
+ let current_exe = env:: current_exe ( ) . expect ( "couldn't get path to rustc shim" ) ;
90
+ let arg0 = exe ( args[ 0 ] . to_str ( ) . expect ( "only utf8 paths are supported" ) , & target_name) ;
91
+ if Path :: new ( & arg0) == current_exe {
89
92
args. remove ( 0 ) ;
90
93
}
91
94
rustc_real
You can’t perform that action at this time.
0 commit comments