From c8feeb6ced8b934fea40d5d4e99527e6bb6e8368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Mon, 13 Nov 2023 14:54:07 +0000 Subject: [PATCH] refer to points and not "elements", and remove unused return value --- compiler/rustc_borrowck/src/region_infer/values.rs | 9 ++++----- compiler/rustc_borrowck/src/type_check/liveness/trace.rs | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_borrowck/src/region_infer/values.rs b/compiler/rustc_borrowck/src/region_infer/values.rs index 03630f0e2bcb..2e15dee0c81f 100644 --- a/compiler/rustc_borrowck/src/region_infer/values.rs +++ b/compiler/rustc_borrowck/src/region_infer/values.rs @@ -143,11 +143,10 @@ impl LivenessValues { self.points.insert(region, point); } - /// Adds all the elements in the given bit array into the given - /// region. Returns whether any of them are newly added. - pub(crate) fn add_elements(&mut self, region: N, locations: &IntervalSet) -> bool { - debug!("LivenessValues::add_elements(region={:?}, locations={:?})", region, locations); - self.points.union_row(region, locations) + /// Records `region` as being live at all the given `points`. + pub(crate) fn add_points(&mut self, region: N, points: &IntervalSet) { + debug!("LivenessValues::add_points(region={:?}, points={:?})", region, points); + self.points.union_row(region, points); } /// Records `region` as being live at all the control-flow points. diff --git a/compiler/rustc_borrowck/src/type_check/liveness/trace.rs b/compiler/rustc_borrowck/src/type_check/liveness/trace.rs index e616449ccd41..2cfbe8a38746 100644 --- a/compiler/rustc_borrowck/src/type_check/liveness/trace.rs +++ b/compiler/rustc_borrowck/src/type_check/liveness/trace.rs @@ -618,7 +618,7 @@ impl<'tcx> LivenessContext<'_, '_, '_, 'tcx> { .borrowck_context .constraints .liveness_constraints - .add_elements(live_region_vid, live_at); + .add_points(live_region_vid, live_at); // There can only be inflowing loans for this region when we are using // `-Zpolonius=next`.