Skip to content

Commit 3abf0e3

Browse files
committed
rename debugging support functions
1 parent aa481bd commit 3abf0e3

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

Diff for: compiler/rustc_borrowck/src/region_infer/values.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,10 @@ impl LivenessValues {
172172
.take_while(move |&p| self.elements.point_in_range(p))
173173
}
174174

175-
/// Returns a "pretty" string value of the region. Meant for debugging.
175+
/// For debugging purposes, returns a pretty-printed string of the points where the `region` is
176+
/// live.
176177
pub(crate) fn region_value_str(&self, region: RegionVid) -> String {
177-
region_value_str(
178+
pretty_print_region_elements(
178179
self.live_points(region).map(|p| RegionElement::Location(self.elements.to_location(p))),
179180
)
180181
}
@@ -378,7 +379,7 @@ impl<N: Idx> RegionValues<N> {
378379

379380
/// Returns a "pretty" string value of the region. Meant for debugging.
380381
pub(crate) fn region_value_str(&self, r: N) -> String {
381-
region_value_str(self.elements_contained_in(r))
382+
pretty_print_region_elements(self.elements_contained_in(r))
382383
}
383384
}
384385

@@ -422,11 +423,12 @@ impl ToElementIndex for ty::PlaceholderRegion {
422423
}
423424
}
424425

425-
pub(crate) fn location_set_str(
426+
/// For debugging purposes, returns a pretty-printed string of the given points.
427+
pub(crate) fn pretty_print_points(
426428
elements: &RegionValueElements,
427429
points: impl IntoIterator<Item = PointIndex>,
428430
) -> String {
429-
region_value_str(
431+
pretty_print_region_elements(
430432
points
431433
.into_iter()
432434
.take_while(|&p| elements.point_in_range(p))
@@ -435,7 +437,8 @@ pub(crate) fn location_set_str(
435437
)
436438
}
437439

438-
fn region_value_str(elements: impl IntoIterator<Item = RegionElement>) -> String {
440+
/// For debugging purposes, returns a pretty-printed string of the given region elements.
441+
fn pretty_print_region_elements(elements: impl IntoIterator<Item = RegionElement>) -> String {
439442
let mut result = String::new();
440443
result.push('{');
441444

Diff for: compiler/rustc_borrowck/src/type_check/liveness/trace.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ impl<'tcx> LivenessContext<'_, '_, '_, 'tcx> {
550550
dropped_local,
551551
dropped_ty,
552552
drop_locations,
553-
values::location_set_str(self.elements, live_at.iter()),
553+
values::pretty_print_points(self.elements, live_at.iter()),
554554
);
555555

556556
let drop_data = self.drop_data.entry(dropped_ty).or_insert_with({
@@ -599,7 +599,7 @@ impl<'tcx> LivenessContext<'_, '_, '_, 'tcx> {
599599
debug!("make_all_regions_live(value={:?})", value);
600600
debug!(
601601
"make_all_regions_live: live_at={}",
602-
values::location_set_str(elements, live_at.iter()),
602+
values::pretty_print_points(elements, live_at.iter()),
603603
);
604604

605605
// When using `-Zpolonius=next`, we want to record the loans that flow into this value's

0 commit comments

Comments
 (0)