Skip to content

Commit 3e93027

Browse files
committed
Auto merge of #78592 - fpoli:nll-facts-dir, r=matthewjasper
Add option to customize the nll-facts' folder location This PR adds a `nll-facts-dir` option to specify the location of the directory in which NLL facts are dumped into. It works the same way `dump-mir-dir` controls the location used by the `dump-mir` option.
2 parents d8ef0d7 + 97a65b6 commit 3e93027

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

compiler/rustc_mir/src/borrow_check/nll.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ pub(in crate::borrow_check) fn compute_regions<'cx, 'tcx>(
275275
let polonius_output = all_facts.and_then(|all_facts| {
276276
if infcx.tcx.sess.opts.debugging_opts.nll_facts {
277277
let def_path = infcx.tcx.def_path(def_id);
278-
let dir_path =
279-
PathBuf::from("nll-facts").join(def_path.to_filename_friendly_no_crate());
278+
let dir_path = PathBuf::from(&infcx.tcx.sess.opts.debugging_opts.nll_facts_dir)
279+
.join(def_path.to_filename_friendly_no_crate());
280280
all_facts.write_to_dir(dir_path, location_table).unwrap();
281281
}
282282

compiler/rustc_session/src/options.rs

+2
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
971971
"use new LLVM pass manager (default: no)"),
972972
nll_facts: bool = (false, parse_bool, [UNTRACKED],
973973
"dump facts from NLL analysis into side files (default: no)"),
974+
nll_facts_dir: String = ("nll-facts".to_string(), parse_string, [UNTRACKED],
975+
"the directory the NLL facts are dumped into (default: `nll-facts`)"),
974976
no_analysis: bool = (false, parse_no_flag, [UNTRACKED],
975977
"parse and expand the source, but run no analysis"),
976978
no_codegen: bool = (false, parse_no_flag, [TRACKED],

0 commit comments

Comments
 (0)