File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
librustc_mir/borrow_check Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -2048,12 +2048,19 @@ impl<'tcx> Place<'tcx> {
20482048 /// Recursively "iterates" over place components, generating a `PlaceComponents` list,
20492049 /// invoking `op` with a `PlaceComponentsIter`.
20502050 pub fn iterate < R > (
2051+ & self ,
2052+ op : impl FnOnce ( PlaceComponentsIter < ' _ , ' tcx > ) -> R ,
2053+ ) -> R {
2054+ self . iterate2 ( None , op)
2055+ }
2056+
2057+ fn iterate2 < R > (
20512058 & self ,
20522059 next : Option < & PlaceComponents < ' _ , ' tcx > > ,
20532060 op : impl FnOnce ( PlaceComponentsIter < ' _ , ' tcx > ) -> R ,
20542061 ) -> R {
20552062 match self {
2056- Place :: Projection ( interior) => interior. base . iterate (
2063+ Place :: Projection ( interior) => interior. base . iterate2 (
20572064 Some ( & PlaceComponents {
20582065 component : self ,
20592066 next,
Original file line number Diff line number Diff line change @@ -67,8 +67,8 @@ pub(super) fn borrow_conflicts_with_place<'gcx, 'tcx>(
6767 }
6868 }
6969
70- borrow_place. iterate ( None , |borrow_components| {
71- access_place. iterate ( None , |access_components| {
70+ borrow_place. iterate ( |borrow_components| {
71+ access_place. iterate ( |access_components| {
7272 place_components_conflict (
7373 tcx,
7474 mir,
You can’t perform that action at this time.
0 commit comments