diff --git a/tests/testsuite/support/mod.rs b/tests/testsuite/support/mod.rs index 3c183330fc8..36c146a049d 100644 --- a/tests/testsuite/support/mod.rs +++ b/tests/testsuite/support/mod.rs @@ -791,7 +791,8 @@ impl Execs { pub fn cwd>(&mut self, path: T) -> &mut Self { if let Some(ref mut p) = self.process_builder { if let Some(cwd) = p.get_cwd() { - p.cwd(cwd.join(path.as_ref())); + let new_path = cwd.join(path.as_ref()); + p.cwd(new_path); } else { p.cwd(path); }