diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2019-02-27 21:25:17 +0100 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2019-04-17 19:44:17 +0200 |
| commit | 53fa32fe50e2f9df37f59f061402f131827d5e94 (patch) | |
| tree | 9cd33e81f3b0f35d6efc76334fe425342a4dcf05 | |
| parent | 66fe4ff7d504913cbab96fa8e697437bf24b5204 (diff) | |
| download | rust-53fa32fe50e2f9df37f59f061402f131827d5e94.tar.gz rust-53fa32fe50e2f9df37f59f061402f131827d5e94.zip | |
Place::unroll -> Place::iterate
| -rw-r--r-- | src/librustc/mir/mod.rs | 8 | ||||
| -rw-r--r-- | src/librustc_mir/borrow_check/places_conflict.rs | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs index 6289b78af9b..60c7c256ec7 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<R>( + pub fn iterate<R>( &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 4f1fbea9832..45bbbbc92d9 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, |
