diff options
| author | bors <bors@rust-lang.org> | 2017-06-04 17:51:46 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-06-04 17:51:46 +0000 |
| commit | 9a4e13f5c43a6eaf97ab3b62c5f1d2d9ab4f3d6e (patch) | |
| tree | 276156408b6bc1a2d15302397ecc58bda347a1f2 | |
| parent | 341f4534488a3f56b8b9e188c1f4f52ed7707389 (diff) | |
| parent | 82caf2132ddf14baf47896ba658788bd17a48dae (diff) | |
| download | rust-9a4e13f5c43a6eaf97ab3b62c5f1d2d9ab4f3d6e.tar.gz rust-9a4e13f5c43a6eaf97ab3b62c5f1d2d9ab4f3d6e.zip | |
Auto merge of #42402 - citizen428:create-dump-mir-dir, r=Mark-Simulacrum
Create directory for dump-mir-dir automatically Fixes #35543 r? @Mark-Simulacrum @Mark-Simulacrum I know someone else said that they'll work on this, but it has been 3+ weeks and I had nothing to do and wanted to contribute a bit. I now added the call to automatically create the directory as discussed, but was wondering how you feel about the suggestion to set a default directory, i.e. `target/mir`?
| -rw-r--r-- | src/librustc_mir/util/pretty.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/librustc_mir/util/pretty.rs b/src/librustc_mir/util/pretty.rs index eaba573dcd2..22a8c4378d4 100644 --- a/src/librustc_mir/util/pretty.rs +++ b/src/librustc_mir/util/pretty.rs @@ -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); |
