File tree 1 file changed +6
-9
lines changed
src/tools/compiletest/src
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> {
2802
2802
normalized
2803
2803
}
2804
2804
2805
- fn expected_output_path ( & self , kind : & str ) -> Result < PathBuf , String > {
2805
+ fn load_expected_output ( & self , kind : & str ) -> String {
2806
2806
let mut path = expected_output_path ( & self . testpaths ,
2807
2807
self . revision ,
2808
2808
& self . config . compare_mode ,
@@ -2814,18 +2814,15 @@ impl<'test> TestCx<'test> {
2814
2814
}
2815
2815
2816
2816
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
+ }
2818
2821
} else {
2819
- Err ( String :: from ( "no existing output_path found" ) )
2822
+ String :: new ( )
2820
2823
}
2821
2824
}
2822
2825
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
-
2829
2826
fn load_expected_output_from_path ( & self , path : & Path ) -> Result < String , String > {
2830
2827
let mut result = String :: new ( ) ;
2831
2828
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