11use crate :: borrow_check:: place_ext:: PlaceExt ;
22use crate :: borrow_check:: nll:: ToRegionVid ;
3+ use crate :: borrow_check:: path_utils:: allow_two_phase_borrow;
34use crate :: dataflow:: indexes:: BorrowIndex ;
45use crate :: dataflow:: move_paths:: MoveData ;
56use rustc:: mir:: traversal;
@@ -299,12 +300,6 @@ impl<'a, 'gcx, 'tcx> Visitor<'tcx> for GatherBorrows<'a, 'gcx, 'tcx> {
299300}
300301
301302impl < ' a , ' gcx , ' tcx > GatherBorrows < ' a , ' gcx , ' tcx > {
302- /// Returns `true` if the borrow represented by `kind` is
303- /// allowed to be split into separate Reservation and
304- /// Activation phases.
305- fn allow_two_phase_borrow ( & self , kind : mir:: BorrowKind ) -> bool {
306- kind. allows_two_phase_borrow ( )
307- }
308303
309304 /// If this is a two-phase borrow, then we will record it
310305 /// as "pending" until we find the activating use.
@@ -320,7 +315,7 @@ impl<'a, 'gcx, 'tcx> GatherBorrows<'a, 'gcx, 'tcx> {
320315 start_location, assigned_place, borrow_index,
321316 ) ;
322317
323- if !self . allow_two_phase_borrow ( kind) {
318+ if !allow_two_phase_borrow ( & self . tcx , kind) {
324319 debug ! ( " -> {:?}" , start_location) ;
325320 return ;
326321 }
0 commit comments