Create directory for dump-mir-dir automatically

Fixes #35543
This commit is contained in:
Michael Kohl 2017-06-03 14:38:45 +07:00
parent 14526a3744
commit 82caf2132d

View File

@ -111,6 +111,7 @@ fn dump_matched_mir_node<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
let p = Path::new(file_dir);
file_path.push(p);
};
let _ = fs::create_dir_all(&file_path);
let file_name = format!("rustc.node{}{}{}.{}.{}.mir",
source.item_id(), promotion_id, pass_num, pass_name, disambiguator);
file_path.push(&file_name);