From 9b1147f45c9809a16dd45b94eca2569ad0704c1c Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 8 Jun 2019 16:29:31 -0700 Subject: [PATCH] Clear CARGO_TARGET_DIR for tests. --- tests/support/client/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/support/client/mod.rs b/tests/support/client/mod.rs index a84c4e3eb5f..6847363a8e0 100644 --- a/tests/support/client/mod.rs +++ b/tests/support/client/mod.rs @@ -59,6 +59,10 @@ impl Project { let mut cmd = Command::new(rls_exe()); cmd.current_dir(self.root()); cmd.stderr(Stdio::inherit()); + // If `CARGO_TARGET_DIR` is set (such as in rust-lang/rust), don't + // reuse it. Each test needs its own target directory so they don't + // stomp on each other's files. + cmd.env_remove("CARGO_TARGET_DIR"); cmd }