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 @@ -3338,6 +3338,10 @@ impl<'test> TestCx<'test> {
3338
3338
}
3339
3339
3340
3340
fn delete_file ( & self , file : & PathBuf ) {
3341
+ if !file. exists ( ) {
3342
+ // Deleting a nonexistant file would error.
3343
+ return ;
3344
+ }
3341
3345
if let Err ( e) = fs:: remove_file ( file) {
3342
3346
self . fatal ( & format ! ( "failed to delete `{}`: {}" , file. display( ) , e, ) ) ;
3343
3347
}
@@ -3400,7 +3404,7 @@ impl<'test> TestCx<'test> {
3400
3404
let examined_content =
3401
3405
self . load_expected_output_from_path ( & examined_path) . unwrap_or_else ( |_| String :: new ( ) ) ;
3402
3406
3403
- if examined_path . exists ( ) && canon_content == & examined_content {
3407
+ if canon_content == & examined_content {
3404
3408
self . delete_file ( & examined_path) ;
3405
3409
}
3406
3410
}
You can’t perform that action at this time.
0 commit comments