Skip to content

Commit 09421fd

Browse files
committed
Pass target directory as flag instead of env variable
1 parent b8eae19 commit 09421fd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/flycheck/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,6 @@ impl FlycheckActor {
360360
let mut cmd = Command::new(command);
361361
cmd.envs(extra_env);
362362

363-
if let Some(target_dir) = target_dir {
364-
cmd.env("CARGO_TARGET_DIR", target_dir);
365-
}
366-
367363
match invocation_location {
368364
InvocationLocation::Workspace => {
369365
match invocation_strategy {
@@ -381,6 +377,10 @@ impl FlycheckActor {
381377
}
382378
}
383379

380+
if let Some(target_dir) = target_dir {
381+
cmd.arg("--target-dir").arg(target_dir);
382+
}
383+
384384
(cmd, args)
385385
}
386386
};

0 commit comments

Comments
 (0)