about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRémy Rakic <remy.rakic+github@gmail.com>2023-11-23 11:54:49 +0000
committerRémy Rakic <remy.rakic+github@gmail.com>2023-11-26 12:00:32 +0000
commit49010833e93ba52ee94934a5af6233631f14873a (patch)
tree8bd07989844300b8054c56c364a81976ff74a0db
parent16a5da7be23a9cb8297c2baa350ac86c889f49dc (diff)
downloadrust-49010833e93ba52ee94934a5af6233631f14873a.tar.gz
rust-49010833e93ba52ee94934a5af6233631f14873a.zip
another trivial cleanup
fix a comment and move a variable where it's used
-rw-r--r--compiler/rustc_borrowck/src/nll.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_borrowck/src/nll.rs b/compiler/rustc_borrowck/src/nll.rs
index 0e1f48902e3..7fa702c2882 100644
--- a/compiler/rustc_borrowck/src/nll.rs
+++ b/compiler/rustc_borrowck/src/nll.rs
@@ -182,11 +182,10 @@ pub(crate) fn compute_regions<'cx, 'tcx>(
         borrow_set,
     );
 
-    let def_id = body.source.def_id();
-
-    // Dump facts if requested.
+    // If requested: dump NLL facts, and run legacy polonius analysis.
     let polonius_output = all_facts.as_ref().and_then(|all_facts| {
         if infcx.tcx.sess.opts.unstable_opts.nll_facts {
+            let def_id = body.source.def_id();
             let def_path = infcx.tcx.def_path(def_id);
             let dir_path = PathBuf::from(&infcx.tcx.sess.opts.unstable_opts.nll_facts_dir)
                 .join(def_path.to_filename_friendly_no_crate());