From 97a65b6f81927d42d78d9f5c647441f86ce19696 Mon Sep 17 00:00:00 2001 From: Federico Poli Date: Fri, 30 Oct 2020 17:59:43 +0100 Subject: [PATCH] Add option to customize the nll-facts' folder location --- compiler/rustc_mir/src/borrow_check/nll.rs | 4 ++-- compiler/rustc_session/src/options.rs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_mir/src/borrow_check/nll.rs b/compiler/rustc_mir/src/borrow_check/nll.rs index aa428328fe9..359c5f261a4 100644 --- a/compiler/rustc_mir/src/borrow_check/nll.rs +++ b/compiler/rustc_mir/src/borrow_check/nll.rs @@ -275,8 +275,8 @@ pub(in crate::borrow_check) fn compute_regions<'cx, 'tcx>( let polonius_output = all_facts.and_then(|all_facts| { if infcx.tcx.sess.opts.debugging_opts.nll_facts { let def_path = infcx.tcx.def_path(def_id); - let dir_path = - PathBuf::from("nll-facts").join(def_path.to_filename_friendly_no_crate()); + let dir_path = PathBuf::from(&infcx.tcx.sess.opts.debugging_opts.nll_facts_dir) + .join(def_path.to_filename_friendly_no_crate()); all_facts.write_to_dir(dir_path, location_table).unwrap(); } diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs index 750f2e19ee2..e4b6ae47fd3 100644 --- a/compiler/rustc_session/src/options.rs +++ b/compiler/rustc_session/src/options.rs @@ -969,6 +969,8 @@ fn parse_target_feature(slot: &mut String, v: Option<&str>) -> bool { "use new LLVM pass manager (default: no)"), nll_facts: bool = (false, parse_bool, [UNTRACKED], "dump facts from NLL analysis into side files (default: no)"), + nll_facts_dir: String = ("nll-facts".to_string(), parse_string, [UNTRACKED], + "the directory the NLL facts are dumped into (default: `nll-facts`)"), no_analysis: bool = (false, parse_no_flag, [UNTRACKED], "parse and expand the source, but run no analysis"), no_codegen: bool = (false, parse_no_flag, [TRACKED],