diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2018-11-16 19:13:55 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2019-01-02 17:35:05 -0500 |
| commit | 995192a472220786e22ccdf3658671d5589b30dd (patch) | |
| tree | baa47058fcdffe6dbd76db93d3a9f27c6122155c | |
| parent | 0b03b9bbcfbac0765d79efbd83b36e9970c56b49 (diff) | |
| download | rust-995192a472220786e22ccdf3658671d5589b30dd.tar.gz rust-995192a472220786e22ccdf3658671d5589b30dd.zip | |
make `get_highlight_region_for_regionvid` only affect re-vid
In NLL, ReVid is all there is, but I might want to repurpose.
| -rw-r--r-- | src/librustc/util/ppaux.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs index 318d7adb190..cbba4181271 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -771,7 +771,7 @@ define_print! { define_print! { () ty::RegionKind, (self, f, cx) { display { - if cx.is_verbose || get_highlight_region_for_regionvid().is_some() { + if cx.is_verbose { return self.print_debug(f, cx); } @@ -806,11 +806,16 @@ define_print! { ), } } - ty::ReVar(region_vid) if cx.identify_regions => { - write!(f, "'{}rv", region_vid.index()) + ty::ReVar(region_vid) => { + if get_highlight_region_for_regionvid().is_some() { + write!(f, "{:?}", region_vid) + } else if cx.identify_regions { + write!(f, "'{}rv", region_vid.index()) + } else { + Ok(()) + } } ty::ReScope(_) | - ty::ReVar(_) | ty::ReErased => Ok(()), ty::ReStatic => write!(f, "'static"), ty::ReEmpty => write!(f, "'<empty>"), |
