Rollup merge of #43458 - RalfJung:verbose, r=nikomatsakis

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.
This commit is contained in:
Mark Simulacrum 2017-07-26 06:15:05 -06:00 committed by GitHub
commit 7fa104f041

View File

@ -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)