mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 09:13:07 +03:00
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:
@@ -1208,13 +1208,13 @@ fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user