diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2018-11-19 10:29:50 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2019-01-02 17:35:06 -0500 |
| commit | cf2f7cccb4fc170cd395f47569e8280e7081bf25 (patch) | |
| tree | 6d0852db4e8b393598295de1beb0536df4fdc3d8 | |
| parent | bc4404c0b501729cc5df05544e5f0784789f4215 (diff) | |
| download | rust-cf2f7cccb4fc170cd395f47569e8280e7081bf25.tar.gz rust-cf2f7cccb4fc170cd395f47569e8280e7081bf25.zip | |
pacify the mercilous tidy
| -rw-r--r-- | src/librustc/util/ppaux.rs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs index 0742d0aebe9..79405b12400 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -90,7 +90,11 @@ impl RegionHighlightMode { /// During the execution of `op`, highlight the region inference /// vairable `vid` as `'N`. We can only highlight one region vid /// at a time. - pub fn highlighting_region<R>(region: ty::Region<'_>, number: usize, op: impl FnOnce() -> R) -> R { + pub fn highlighting_region<R>( + region: ty::Region<'_>, + number: usize, + op: impl FnOnce() -> R, + ) -> R { let old_mode = Self::get(); let mut new_mode = old_mode; let first_avail_slot = new_mode.highlight_regions.iter_mut() @@ -1076,12 +1080,10 @@ impl fmt::Debug for ty::FloatVid { impl fmt::Debug for ty::RegionVid { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - if RegionHighlightMode::get().any_region_vids_highlighted() { - if let Some(counter) = RegionHighlightMode::get().region_highlighted(&ty::ReVar(*self)) { - return write!(f, "'{:?}", counter); - } else { - return write!(f, "'_"); - } + if let Some(counter) = RegionHighlightMode::get().region_highlighted(&ty::ReVar(*self)) { + return write!(f, "'{:?}", counter); + } else if RegionHighlightMode::get().any_region_vids_highlighted() { + return write!(f, "'_"); } write!(f, "'_#{}r", self.index()) |
