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> {
33383338 }
33393339
33403340 fn delete_file ( & self , file : & PathBuf ) {
3341+ if !file. exists ( ) {
3342+ // Deleting a nonexistant file would error.
3343+ return ;
3344+ }
33413345 if let Err ( e) = fs:: remove_file ( file) {
33423346 self . fatal ( & format ! ( "failed to delete `{}`: {}" , file. display( ) , e, ) ) ;
33433347 }
@@ -3400,7 +3404,7 @@ impl<'test> TestCx<'test> {
34003404 let examined_content =
34013405 self . load_expected_output_from_path ( & examined_path) . unwrap_or_else ( |_| String :: new ( ) ) ;
34023406
3403- if examined_path . exists ( ) && canon_content == & examined_content {
3407+ if canon_content == & examined_content {
34043408 self . delete_file ( & examined_path) ;
34053409 }
34063410 }
You can’t perform that action at this time.
0 commit comments