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 0f72ce1 commit 44e8a9aCopy full SHA for 44e8a9a
src/tools/compiletest/src/runtest.rs
@@ -3445,6 +3445,10 @@ impl<'test> TestCx<'test> {
3445
}
3446
3447
fn delete_file(&self, file: &PathBuf) {
3448
+ if !file.exists() {
3449
+ // Deleting a nonexistant file would error.
3450
+ return;
3451
+ }
3452
if let Err(e) = fs::remove_file(file) {
3453
self.fatal(&format!("failed to delete `{}`: {}", file.display(), e,));
3454
@@ -3507,7 +3511,7 @@ impl<'test> TestCx<'test> {
3507
3511
let examined_content =
3508
3512
self.load_expected_output_from_path(&examined_path).unwrap_or_else(|_| String::new());
3509
3513
3510
- if examined_path.exists() && canon_content == &examined_content {
3514
+ if canon_content == &examined_content {
3515
self.delete_file(&examined_path);
3516
3517
0 commit comments