about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2018-05-29 15:09:37 -0400
committerNiko Matsakis <niko@alum.mit.edu>2018-05-29 15:09:37 -0400
commit948f77c71ff8fdfda0bec2f335498e8de075799a (patch)
treeb0567de54186964e77cced7510d2bf0d97052f0a
parent62b1e6532adce4847153f6b6ac197d5906d389d0 (diff)
downloadrust-948f77c71ff8fdfda0bec2f335498e8de075799a.tar.gz
rust-948f77c71ff8fdfda0bec2f335498e8de075799a.zip
tweak debug output some more
-rw-r--r--src/librustc_mir/borrow_check/nll/region_infer/mod.rs2
-rw-r--r--src/librustc_mir/dataflow/impls/borrows.rs9
2 files changed, 8 insertions, 3 deletions
diff --git a/src/librustc_mir/borrow_check/nll/region_infer/mod.rs b/src/librustc_mir/borrow_check/nll/region_infer/mod.rs
index 5a1ab73b2b8..dea2683789b 100644
--- a/src/librustc_mir/borrow_check/nll/region_infer/mod.rs
+++ b/src/librustc_mir/borrow_check/nll/region_infer/mod.rs
@@ -352,7 +352,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
     }
 
     /// Returns access to the value of `r` for debugging purposes.
-    pub(super) fn region_value_str(&self, r: RegionVid) -> String {
+    crate fn region_value_str(&self, r: RegionVid) -> String {
         let inferred_values = self.inferred_values
             .as_ref()
             .expect("region values not yet inferred");
diff --git a/src/librustc_mir/dataflow/impls/borrows.rs b/src/librustc_mir/dataflow/impls/borrows.rs
index b8949e0ad06..59ff12eface 100644
--- a/src/librustc_mir/dataflow/impls/borrows.rs
+++ b/src/librustc_mir/dataflow/impls/borrows.rs
@@ -66,8 +66,13 @@ fn precompute_borrows_out_of_scope<'a, 'tcx>(
     let mut visited = FxHashSet();
     visited.insert(location);
 
-    debug!("borrow {:?} (region: {:?}) starts at {:?}",
-           borrow_index, borrow_region, location);
+    debug!(
+        "borrow {:?} has region {:?} with value {:?}",
+        borrow_index,
+        borrow_region,
+        regioncx.region_value_str(borrow_region),
+    );
+    debug!("borrow {:?} starts at {:?}", borrow_index, location);
     while let Some(location) = stack.pop() {
         // If region does not contain a point at the location, then add to list and skip
         // successor locations.