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 @@ -2062,12 +2062,19 @@ impl<'tcx> Place<'tcx> {
20622062 /// Recursively "iterates" over place components, generating a `PlaceComponents` list,
20632063 /// invoking `op` with a `PlaceComponentsIter`.
20642064 pub fn iterate < R > (
2065+ & self ,
2066+ op : impl FnOnce ( PlaceComponentsIter < ' _ , ' tcx > ) -> R ,
2067+ ) -> R {
2068+ self . iterate2 ( None , op)
2069+ }
2070+
2071+ fn iterate2 < R > (
20652072 & self ,
20662073 next : Option < & PlaceComponents < ' _ , ' tcx > > ,
20672074 op : impl FnOnce ( PlaceComponentsIter < ' _ , ' tcx > ) -> R ,
20682075 ) -> R {
20692076 match self {
2070- Place :: Projection ( interior) => interior. base . iterate (
2077+ Place :: Projection ( interior) => interior. base . iterate2 (
20712078 Some ( & PlaceComponents {
20722079 component : self ,
20732080 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