about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMark Simulacrum <mark.simulacrum@gmail.com>2017-07-26 06:15:05 -0600
committerGitHub <noreply@github.com>2017-07-26 06:15:05 -0600
commit7fa104f0418edcb6e8ff1f0e86ca68dba3b58ce4 (patch)
tree0e96a5e609d27e60b420a2bf5dffbb87b80da95e /src
parent25e5f0a48d2b88a98e113d7fcd8c74ec56a88afb (diff)
parent4e1249d75f420392d7f1f45188d39d32cdab2662 (diff)
downloadrust-7fa104f0418edcb6e8ff1f0e86ca68dba3b58ce4.tar.gz
rust-7fa104f0418edcb6e8ff1f0e86ca68dba3b58ce4.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/librustc/mir/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs
index d176ae761e1..d78e17ce03c 100644
--- a/src/librustc/mir/mod.rs
+++ b/src/librustc/mir/mod.rs
@@ -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)