pacify the mercilous tidy

This commit is contained in:
Niko Matsakis 2018-11-19 10:29:50 -05:00
parent bc4404c0b5
commit cf2f7cccb4

View File

@ -90,7 +90,11 @@ pub fn maybe_highlighting_region<R>(
/// During the execution of `op`, highlight the region inference /// During the execution of `op`, highlight the region inference
/// vairable `vid` as `'N`. We can only highlight one region vid /// vairable `vid` as `'N`. We can only highlight one region vid
/// at a time. /// 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 old_mode = Self::get();
let mut new_mode = old_mode; let mut new_mode = old_mode;
let first_avail_slot = new_mode.highlight_regions.iter_mut() let first_avail_slot = new_mode.highlight_regions.iter_mut()
@ -1076,12 +1080,10 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
impl fmt::Debug for ty::RegionVid { impl fmt::Debug for ty::RegionVid {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 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)) {
if let Some(counter) = RegionHighlightMode::get().region_highlighted(&ty::ReVar(*self)) { return write!(f, "'{:?}", counter);
return write!(f, "'{:?}", counter); } else if RegionHighlightMode::get().any_region_vids_highlighted() {
} else { return write!(f, "'_");
return write!(f, "'_");
}
} }
write!(f, "'_#{}r", self.index()) write!(f, "'_#{}r", self.index())