File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/tools/compiletest/src Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -3445,6 +3445,10 @@ impl<'test> TestCx<'test> {
3445
3445
}
3446
3446
3447
3447
fn delete_file ( & self , file : & PathBuf ) {
3448
+ if !file. exists ( ) {
3449
+ // Deleting a nonexistant file would error.
3450
+ return ;
3451
+ }
3448
3452
if let Err ( e) = fs:: remove_file ( file) {
3449
3453
self . fatal ( & format ! ( "failed to delete `{}`: {}" , file. display( ) , e, ) ) ;
3450
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 {
3511
3515
self . delete_file ( & examined_path) ;
3512
3516
}
3513
3517
}
You can’t perform that action at this time.
0 commit comments