Skip to content

Commit 7fa104f

Browse files
Rollup merge of rust-lang#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.
2 parents 25e5f0a + 4e1249d commit 7fa104f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc/mir/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1208,13 +1208,13 @@ impl<'tcx> Debug for Rvalue<'tcx> {
12081208
BorrowKind::Mut | BorrowKind::Unique => "mut ",
12091209
};
12101210

1211-
// When identifying regions, add trailing space if
1212-
// necessary.
1213-
let region = if ppaux::identify_regions() {
1211+
// When printing regions, add trailing space if necessary.
1212+
let region = if ppaux::verbose() || ppaux::identify_regions() {
12141213
let mut region = format!("{}", region);
12151214
if region.len() > 0 { region.push(' '); }
12161215
region
12171216
} else {
1217+
// Do not even print 'static
12181218
"".to_owned()
12191219
};
12201220
write!(fmt, "&{}{}{:?}", region, kind_str, lv)

0 commit comments

Comments
 (0)