Skip to content

Commit bd8943c

Browse files
committed
Place::unroll -> Place::iterate
1 parent 7048b08 commit bd8943c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/librustc/mir/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2045,15 +2045,15 @@ impl<'tcx> Place<'tcx> {
20452045
}
20462046
}
20472047

2048-
/// Recursively "unroll" a place into a `PlaceComponents` list,
2048+
/// Recursively "iterates" over place components, generating a `PlaceComponents` list,
20492049
/// invoking `op` with a `PlaceComponentsIter`.
2050-
pub fn unroll<R>(
2050+
pub fn iterate<R>(
20512051
&self,
20522052
next: Option<&PlaceComponents<'_, 'tcx>>,
20532053
op: impl FnOnce(PlaceComponentsIter<'_, 'tcx>) -> R,
20542054
) -> R {
20552055
match self {
2056-
Place::Projection(interior) => interior.base.unroll(
2056+
Place::Projection(interior) => interior.base.iterate(
20572057
Some(&PlaceComponents {
20582058
component: self,
20592059
next,
@@ -2076,7 +2076,7 @@ impl<'tcx> Place<'tcx> {
20762076
/// A linked list of places running up the stack; begins with the
20772077
/// innermost place and extends to projections (e.g., `a.b` would have
20782078
/// the place `a` with a "next" pointer to `a.b`). Created by
2079-
/// `Place::unroll`.
2079+
/// `Place::iterate`.
20802080
///
20812081
/// N.B., this particular impl strategy is not the most obvious. It was
20822082
/// chosen because it makes a measurable difference to NLL

src/librustc_mir/borrow_check/places_conflict.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ pub(super) fn borrow_conflicts_with_place<'gcx, 'tcx>(
6767
}
6868
}
6969

70-
borrow_place.unroll(None, |borrow_components| {
71-
access_place.unroll(None, |access_components| {
70+
borrow_place.iterate(None, |borrow_components| {
71+
access_place.iterate(None, |access_components| {
7272
place_components_conflict(
7373
tcx,
7474
mir,

0 commit comments

Comments
 (0)