mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-10 19:16:51 +00: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:
commit
7fa104f041
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user