Skip to content

Commit

Permalink
make get_highlight_region_for_regionvid only affect re-vid
Browse files Browse the repository at this point in the history
In NLL, ReVid is all there is, but I might want to repurpose.
  • Loading branch information
nikomatsakis committed Jan 2, 2019
1 parent 0b03b9b commit 995192a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/librustc/util/ppaux.rs
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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>"),
Expand Down

0 comments on commit 995192a

Please sign in to comment.