diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2018-07-25 16:19:16 +0300 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2018-07-25 16:19:16 +0300 |
| commit | 76991ea2377f1652846b89b2a1eb6a67fef7ecf3 (patch) | |
| tree | 2c3d40a1e5888e1dae7fecf23e35add98e23a82b /src | |
| parent | fa69e2183a97a139e1c5c5d4da9e8cd805d05084 (diff) | |
[WIP] debug logs in error-reporting
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs b/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs index 4472488a773..d329718cf94 100644 --- a/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs +++ b/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs @@ -81,7 +81,18 @@ impl<'tcx> RegionInferenceContext<'tcx> { let (path, target_region) = self .find_constraint_paths_between_regions(from_region, target_test) .unwrap(); - debug!("best_blame_constraint: path={:#?}", path); + debug!( + "best_blame_constraint: path={:#?}", + path.iter() + .map(|&ci| format!( + "{:?}: {:?} ({:?}: {:?})", + ci, + &self.constraints[ci], + self.constraint_sccs.scc(self.constraints[ci].sup), + self.constraint_sccs.scc(self.constraints[ci].sub), + )) + .collect::<Vec<_>>() + ); // Classify each of the constraints along the path. let mut categorized_path: Vec<(ConstraintCategory, Span)> = path @@ -89,13 +100,13 @@ impl<'tcx> RegionInferenceContext<'tcx> { .map(|&index| self.classify_constraint(index, mir)) .collect(); debug!( - "best_blame_constraint: categorized_path={:?}", + "best_blame_constraint: categorized_path={:#?}", categorized_path ); // Find what appears to be the most interesting path to report to the user. categorized_path.sort_by(|p0, p1| p0.0.cmp(&p1.0)); - debug!("best_blame_constraint: sorted_path={:?}", categorized_path); + debug!("best_blame_constraint: sorted_path={:#?}", categorized_path); let &(category, span) = categorized_path.first().unwrap(); |
