From 948f77c71ff8fdfda0bec2f335498e8de075799a Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 29 May 2018 15:09:37 -0400 Subject: [PATCH] tweak debug output some more --- src/librustc_mir/borrow_check/nll/region_infer/mod.rs | 2 +- src/librustc_mir/dataflow/impls/borrows.rs | 9 +++++++-- 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 5a1ab73b2b81..dea2683789bd 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 b8949e0ad063..59ff12eface0 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.