Skip to content

Commit

Permalink
Rollup merge of rust-lang#43458 - RalfJung:verbose, r=nikomatsakis
Browse files Browse the repository at this point in the history
Fix printing regions with -Z verbose

When dumping MIR with `-Z verbose`, it would print regions on types, but not in the code. It seems the Rvalue printing code tried to be smart and guessed when the `Display` for `Region` would not possibly print anything.

This PR makes it no longer be smart, and just always use the `Display` like all the other code (e.g. printing types) does.
  • Loading branch information
Mark-Simulacrum authored Jul 26, 2017
2 parents 25e5f0a + 4e1249d commit 7fa104f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/librustc/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1208,13 +1208,13 @@ impl<'tcx> Debug for Rvalue<'tcx> {
BorrowKind::Mut | BorrowKind::Unique => "mut ",
};

// When identifying regions, add trailing space if
// necessary.
let region = if ppaux::identify_regions() {
// When printing regions, add trailing space if necessary.
let region = if ppaux::verbose() || ppaux::identify_regions() {
let mut region = format!("{}", region);
if region.len() > 0 { region.push(' '); }
region
} else {
// Do not even print 'static
"".to_owned()
};
write!(fmt, "&{}{}{:?}", region, kind_str, lv)
Expand Down

0 comments on commit 7fa104f

Please sign in to comment.