File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
collector/src/compile/execute Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -330,17 +330,11 @@ impl<'a> CargoProcess<'a> {
330
330
let mut cmd = self . base_command ( self . cwd , cargo_subcommand) ;
331
331
cmd. arg ( "-p" ) . arg ( self . get_pkgid ( self . cwd ) ?) ;
332
332
match self . profile {
333
- Profile :: Check => {
333
+ Profile :: Check | Profile :: Clippy => {
334
334
cmd. arg ( "--profile" ) . arg ( "check" ) ;
335
335
}
336
336
Profile :: Debug => { }
337
337
Profile :: Doc => { }
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
- }
344
338
Profile :: Opt => {
345
339
cmd. arg ( "--release" ) ;
346
340
}
@@ -366,6 +360,15 @@ impl<'a> CargoProcess<'a> {
366
360
// onto rustc for the final crate, which is exactly the crate for which
367
361
// we want to wrap rustc.
368
362
if needs_final {
363
+ if let Profile :: Clippy = self . profile {
364
+ // For Clippy, we still invoke `cargo rustc`, but we need to override the
365
+ // executed rustc to be clippy-fake.
366
+ // We only do this for the final crate, otherwise clippy would be invoked by
367
+ // cargo also for building host code (build scripts/proc macros), which doesn't
368
+ // really work.
369
+ cmd. env ( "RUSTC" , & * FAKE_CLIPPY ) ;
370
+ }
371
+
369
372
let processor = self
370
373
. processor_etc
371
374
. as_mut ( )
You can’t perform that action at this time.
0 commit comments