diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 2a76113460f..59d94e1fa51 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1476,12 +1476,13 @@ impl<'test> TestCx<'test> { } fn compose_and_run_compiler(&self, mut rustc: Command, input: Option) -> ProcRes { - if !self.props.aux_builds.is_empty() { - create_dir_all(&self.aux_output_dir_name()).unwrap(); - } - let aux_dir = self.aux_output_dir_name(); + if !self.props.aux_builds.is_empty() { + let _ = fs::remove_dir_all(&aux_dir); + create_dir_all(&aux_dir).unwrap(); + } + for rel_ab in &self.props.aux_builds { let aux_testpaths = self.compute_aux_test_paths(rel_ab); let aux_props =