File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
src/tools/compiletest/src Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -3239,8 +3239,19 @@ impl<'test> TestCx<'test> {
32393239 }
32403240
32413241 fn diff_mir_files ( & self , before : PathBuf , after : PathBuf ) -> String {
3242- let before = self . get_mir_dump_dir ( ) . join ( before) ;
3243- let after = self . get_mir_dump_dir ( ) . join ( after) ;
3242+ let to_full_path = |path : PathBuf | {
3243+ let full = self . get_mir_dump_dir ( ) . join ( & path) ;
3244+ if !full. exists ( ) {
3245+ panic ! (
3246+ "the mir dump file for {} does not exist (requested in {})" ,
3247+ path. display( ) ,
3248+ self . testpaths. file. display( ) ,
3249+ ) ;
3250+ }
3251+ full
3252+ } ;
3253+ let before = to_full_path ( before) ;
3254+ let after = to_full_path ( after) ;
32443255 debug ! ( "comparing the contents of: {} with {}" , before. display( ) , after. display( ) ) ;
32453256 let before = fs:: read_to_string ( before) . unwrap ( ) ;
32463257 let after = fs:: read_to_string ( after) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments