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> {
34453445 }
34463446
34473447 fn delete_file ( & self , file : & PathBuf ) {
3448+ if !file. exists ( ) {
3449+ // Deleting a nonexistant file would error.
3450+ return ;
3451+ }
34483452 if let Err ( e) = fs:: remove_file ( file) {
34493453 self . fatal ( & format ! ( "failed to delete `{}`: {}" , file. display( ) , e, ) ) ;
34503454 }
@@ -3507,7 +3511,7 @@ impl<'test> TestCx<'test> {
35073511 let examined_content =
35083512 self . load_expected_output_from_path ( & examined_path) . unwrap_or_else ( |_| String :: new ( ) ) ;
35093513
3510- if examined_path . exists ( ) && canon_content == & examined_content {
3514+ if canon_content == & examined_content {
35113515 self . delete_file ( & examined_path) ;
35123516 }
35133517 }
You can’t perform that action at this time.
0 commit comments