From 8a8f2f3d7f6b72da0ef9d5224af42cb9782ae552 Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Sat, 6 Jan 2024 18:35:34 +0000 Subject: [PATCH] Truncate standalone test files instead of removing --- crates/tests/standalone/build.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/tests/standalone/build.rs b/crates/tests/standalone/build.rs index 8af6e7a5897..2b3b2e3657b 100644 --- a/crates/tests/standalone/build.rs +++ b/crates/tests/standalone/build.rs @@ -165,7 +165,10 @@ fn write_no_inner_attr(output: &str, filter: &[&str]) { } fn riddle(output: &str, filter: &[&str], config: &[&str]) { - _ = std::fs::remove_file(output); + _ = std::fs::File::options() + .truncate(true) + .write(true) + .open(output); let mut command = std::process::Command::new("cargo");