@@ -66,10 +66,9 @@ fn main() {
66
66
// otherwise, substitute whatever cargo thinks rustc should be with RUSTC_REAL.
67
67
// NOTE: this means we ignore RUSTC in the environment.
68
68
// FIXME: We might want to consider removing RUSTC_REAL and setting RUSTC directly?
69
- let target_name = target
70
- . map ( |s| s. to_owned ( ) )
71
- . unwrap_or_else ( || env:: var ( "CFG_COMPILER_HOST_TRIPLE" ) . unwrap ( ) ) ;
72
- let is_clippy = args[ 0 ] . to_string_lossy ( ) . ends_with ( & exe ( "clippy-driver" , & target_name) ) ;
69
+ // NOTE: we intentionally pass the name of the host, not the target.
70
+ let host = env:: var ( "CFG_COMPILER_BUILD_TRIPLE" ) . unwrap ( ) ;
71
+ let is_clippy = args[ 0 ] . to_string_lossy ( ) . ends_with ( & exe ( "clippy-driver" , & host) ) ;
73
72
let rustc_driver = if is_clippy {
74
73
if is_build_script {
75
74
// Don't run clippy on build scripts (for one thing, we may not have libstd built with
@@ -85,8 +84,6 @@ fn main() {
85
84
// don't remove the first arg if we're being run as RUSTC instead of RUSTC_WRAPPER.
86
85
// Cargo also sometimes doesn't pass the `.exe` suffix on Windows - add it manually.
87
86
let current_exe = env:: current_exe ( ) . expect ( "couldn't get path to rustc shim" ) ;
88
- // NOTE: we intentionally pass the name of the host, not the target.
89
- let host = env:: var ( "CFG_COMPILER_BUILD_TRIPLE" ) . unwrap ( ) ;
90
87
let arg0 = exe ( args[ 0 ] . to_str ( ) . expect ( "only utf8 paths are supported" ) , & host) ;
91
88
if Path :: new ( & arg0) == current_exe {
92
89
args. remove ( 0 ) ;
0 commit comments