Skip to content

Commit 995192a

Browse files
committed
make get_highlight_region_for_regionvid only affect re-vid
In NLL, ReVid is all there is, but I might want to repurpose.
1 parent 0b03b9b commit 995192a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/librustc/util/ppaux.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ define_print! {
771771
define_print! {
772772
() ty::RegionKind, (self, f, cx) {
773773
display {
774-
if cx.is_verbose || get_highlight_region_for_regionvid().is_some() {
774+
if cx.is_verbose {
775775
return self.print_debug(f, cx);
776776
}
777777

@@ -806,11 +806,16 @@ define_print! {
806806
),
807807
}
808808
}
809-
ty::ReVar(region_vid) if cx.identify_regions => {
810-
write!(f, "'{}rv", region_vid.index())
809+
ty::ReVar(region_vid) => {
810+
if get_highlight_region_for_regionvid().is_some() {
811+
write!(f, "{:?}", region_vid)
812+
} else if cx.identify_regions {
813+
write!(f, "'{}rv", region_vid.index())
814+
} else {
815+
Ok(())
816+
}
811817
}
812818
ty::ReScope(_) |
813-
ty::ReVar(_) |
814819
ty::ReErased => Ok(()),
815820
ty::ReStatic => write!(f, "'static"),
816821
ty::ReEmpty => write!(f, "'<empty>"),

0 commit comments

Comments
 (0)