Skip to content

Commit 2ccc82e

Browse files
committed
Make dump_mir_dir non-optional
1 parent a22e716 commit 2ccc82e

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

src/librustc/session/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
11721172
"emit noalias metadata for mutable references"),
11731173
dump_mir: Option<String> = (None, parse_opt_string, [UNTRACKED],
11741174
"dump MIR state at various points in translation"),
1175-
dump_mir_dir: Option<String> = (Some(String::from("mir_dump")), parse_opt_string, [UNTRACKED],
1175+
dump_mir_dir: String = (String::from("mir_dump"), parse_string, [UNTRACKED],
11761176
"the directory the MIR is dumped into"),
11771177
dump_mir_graphviz: bool = (false, parse_bool, [UNTRACKED],
11781178
"in addition to `.mir` files, create graphviz `.dot` files"),

src/librustc_mir/util/liveness.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -407,10 +407,7 @@ fn dump_matched_mir_node<'a, 'tcx>(
407407
result: &LivenessResult,
408408
) {
409409
let mut file_path = PathBuf::new();
410-
if let Some(ref file_dir) = tcx.sess.opts.debugging_opts.dump_mir_dir {
411-
let p = Path::new(file_dir);
412-
file_path.push(p);
413-
};
410+
file_path.push(Path::new(&tcx.sess.opts.debugging_opts.dump_mir_dir));
414411
let item_id = tcx.hir.as_local_node_id(source.def_id).unwrap();
415412
let file_name = format!("rustc.node{}{}-liveness.mir", item_id, pass_name);
416413
file_path.push(&file_name);

src/librustc_mir/util/pretty.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,7 @@ fn dump_path(
189189
};
190190

191191
let mut file_path = PathBuf::new();
192-
193-
if let Some(ref file_dir) = tcx.sess.opts.debugging_opts.dump_mir_dir {
194-
let p = Path::new(file_dir);
195-
file_path.push(p);
196-
};
192+
file_path.push(Path::new(&tcx.sess.opts.debugging_opts.dump_mir_dir));
197193

198194
let item_name = tcx.hir
199195
.def_path(source.def_id)

0 commit comments

Comments
 (0)