File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -382,7 +382,8 @@ struct CompileTimeOptions {
382
382
#[ arg( long) ]
383
383
rustdoc : Option < PathBuf > ,
384
384
385
- /// The path to the local clippy to measure
385
+ /// The path to the local clippy to measure.
386
+ /// It should be a path to the `clippy-driver` binary.
386
387
#[ arg( long) ]
387
388
clippy : Option < PathBuf > ,
388
389
}
Original file line number Diff line number Diff line change @@ -248,7 +248,7 @@ impl<'a> CargoProcess<'a> {
248
248
} ;
249
249
250
250
if let Some ( c) = & self . toolchain . components . clippy {
251
- cmd. env ( "CLIPPY" , & * FAKE_CLIPPY ) . env ( " CLIPPY_REAL", c) ;
251
+ cmd. env ( "CLIPPY_REAL" , c) ;
252
252
}
253
253
254
254
for config in & self . toolchain . components . cargo_configs {
@@ -335,7 +335,12 @@ impl<'a> CargoProcess<'a> {
335
335
}
336
336
Profile :: Debug => { }
337
337
Profile :: Doc => { }
338
- Profile :: Clippy => { }
338
+ Profile :: Clippy => {
339
+ cmd. arg ( "--profile" ) . arg ( "check" ) ;
340
+ // For Clippy, we still invoke `cargo rustc`, but we need to override the
341
+ // executed rustc to be clippy-fake.
342
+ cmd. env ( "RUSTC" , & * FAKE_CLIPPY ) ;
343
+ }
339
344
Profile :: Opt => {
340
345
cmd. arg ( "--release" ) ;
341
346
}
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ impl SysrootDownload {
128
128
let components = ToolchainComponents :: from_binaries_and_libdir (
129
129
sysroot_bin ( "rustc" ) ?,
130
130
Some ( sysroot_bin ( "rustdoc" ) ?) ,
131
- sysroot_bin ( "cargo- clippy" ) . ok ( ) ,
131
+ sysroot_bin ( "clippy-driver " ) . ok ( ) ,
132
132
sysroot_bin ( "cargo" ) ?,
133
133
& self . directory . join ( & self . rust_sha ) . join ( "lib" ) ,
134
134
) ?;
@@ -484,12 +484,12 @@ pub fn get_local_toolchain(
484
484
)
485
485
} else if profiles. contains ( & Profile :: Clippy ) {
486
486
// We need a `clippy`. Look for one next to `rustc`.
487
- if let Ok ( clippy) = rustc. with_file_name ( "cargo- clippy" ) . canonicalize ( ) {
487
+ if let Ok ( clippy) = rustc. with_file_name ( "clippy-driver " ) . canonicalize ( ) {
488
488
debug ! ( "found clippy: {:?}" , & clippy) ;
489
489
Some ( clippy)
490
490
} else {
491
491
anyhow:: bail!(
492
- "'Clippy' build specified but '--cargo- clippy' not specified and no 'cargo- clippy' found \
492
+ "'Clippy' build specified but '--clippy' not specified and no 'clippy-driver ' found \
493
493
next to 'rustc'"
494
494
) ;
495
495
}
You can’t perform that action at this time.
0 commit comments