Skip to content

Commit

Permalink
Place::unroll -> Place::iterate
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Apr 17, 2019
1 parent 66fe4ff commit 53fa32f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/librustc/mir/mod.rs
Expand Up @@ -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,
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_mir/borrow_check/places_conflict.rs
Expand Up @@ -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,
Expand Down

0 comments on commit 53fa32f

Please sign in to comment.