File tree 1 file changed +13
-2
lines changed
src/tools/compiletest/src
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> {
3239
3239
}
3240
3240
3241
3241
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) ;
3244
3255
debug ! ( "comparing the contents of: {} with {}" , before. display( ) , after. display( ) ) ;
3245
3256
let before = fs:: read_to_string ( before) . unwrap ( ) ;
3246
3257
let after = fs:: read_to_string ( after) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments