diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs index 6289b78af9b9..60c7c256ec74 100644 --- a/src/librustc/mir/mod.rs +++ b/src/librustc/mir/mod.rs @@ -2059,15 +2059,15 @@ impl<'tcx> Place<'tcx> { } } - /// Recursively "unroll" a place into a `PlaceComponents` list, + /// Recursively "iterates" over place components, generating a `PlaceComponents` list, /// invoking `op` with a `PlaceComponentsIter`. - pub fn unroll( + pub fn iterate( &self, next: Option<&PlaceComponents<'_, 'tcx>>, op: impl FnOnce(PlaceComponentsIter<'_, 'tcx>) -> R, ) -> R { match self { - Place::Projection(interior) => interior.base.unroll( + Place::Projection(interior) => interior.base.iterate( Some(&PlaceComponents { component: self, next, @@ -2089,7 +2089,7 @@ impl<'tcx> Place<'tcx> { /// A linked list of places running up the stack; begins with the /// innermost place and extends to projections (e.g., `a.b` would have /// the place `a` with a "next" pointer to `a.b`). Created by -/// `Place::unroll`. +/// `Place::iterate`. /// /// N.B., this particular impl strategy is not the most obvious. It was /// chosen because it makes a measurable difference to NLL diff --git a/src/librustc_mir/borrow_check/places_conflict.rs b/src/librustc_mir/borrow_check/places_conflict.rs index 4f1fbea98329..45bbbbc92d9a 100644 --- a/src/librustc_mir/borrow_check/places_conflict.rs +++ b/src/librustc_mir/borrow_check/places_conflict.rs @@ -67,8 +67,8 @@ pub(super) fn borrow_conflicts_with_place<'gcx, 'tcx>( } } - borrow_place.unroll(None, |borrow_components| { - access_place.unroll(None, |access_components| { + borrow_place.iterate(None, |borrow_components| { + access_place.iterate(None, |access_components| { place_components_conflict( tcx, mir,