File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
src/tools/compiletest/src Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -2802,7 +2802,7 @@ impl<'test> TestCx<'test> {
28022802 normalized
28032803 }
28042804
2805- fn expected_output_path ( & self , kind : & str ) -> Result < PathBuf , String > {
2805+ fn load_expected_output ( & self , kind : & str ) -> String {
28062806 let mut path = expected_output_path ( & self . testpaths ,
28072807 self . revision ,
28082808 & self . config . compare_mode ,
@@ -2814,18 +2814,15 @@ impl<'test> TestCx<'test> {
28142814 }
28152815
28162816 if path. exists ( ) {
2817- Ok ( path)
2817+ match self . load_expected_output_from_path ( & path) {
2818+ Ok ( x) => x,
2819+ Err ( x) => self . fatal ( & x) ,
2820+ }
28182821 } else {
2819- Err ( String :: from ( "no existing output_path found" ) )
2822+ String :: new ( )
28202823 }
28212824 }
28222825
2823- fn load_expected_output ( & self , kind : & str ) -> String {
2824- self . expected_output_path ( kind)
2825- . and_then ( |x| self . load_expected_output_from_path ( & x) )
2826- . unwrap_or_else ( |x| self . fatal ( & x) )
2827- }
2828-
28292826 fn load_expected_output_from_path ( & self , path : & Path ) -> Result < String , String > {
28302827 let mut result = String :: new ( ) ;
28312828 match File :: open ( path) . and_then ( |mut f| f. read_to_string ( & mut result) ) {
You can’t perform that action at this time.
0 commit comments