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> {
330330 let mut cmd = self . base_command ( self . cwd , cargo_subcommand) ;
331331 cmd. arg ( "-p" ) . arg ( self . get_pkgid ( self . cwd ) ?) ;
332332 match self . profile {
333- Profile :: Check => {
333+ Profile :: Check | Profile :: Clippy => {
334334 cmd. arg ( "--profile" ) . arg ( "check" ) ;
335335 }
336336 Profile :: Debug => { }
337337 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- }
344338 Profile :: Opt => {
345339 cmd. arg ( "--release" ) ;
346340 }
@@ -366,6 +360,15 @@ impl<'a> CargoProcess<'a> {
366360 // onto rustc for the final crate, which is exactly the crate for which
367361 // we want to wrap rustc.
368362 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+
369372 let processor = self
370373 . processor_etc
371374 . as_mut ( )
You can’t perform that action at this time.
0 commit comments