We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e92ffc3 commit c287f6eCopy full SHA for c287f6e
src/tools/compiletest/src/runtest.rs
@@ -2766,12 +2766,11 @@ impl<'test> TestCx<'test> {
2766
.map_err(|err| format!("failed to load expected output from `{}`: {}", path, err))
2767
}
2768
2769
+ /// Attempts to delete a file, succeeding if the file does not exist.
2770
fn delete_file(&self, file: &Utf8Path) {
- if !file.exists() {
2771
- // Deleting a nonexistent file would error.
2772
- return;
2773
- }
2774
- if let Err(e) = fs::remove_file(file.as_std_path()) {
+ if let Err(e) = fs::remove_file(file.as_std_path())
+ && e.kind() != io::ErrorKind::NotFound
+ {
2775
self.fatal(&format!("failed to delete `{}`: {}", file, e,));
2776
2777
0 commit comments