1
1
use crate :: borrow_check:: place_ext:: PlaceExt ;
2
2
use crate :: borrow_check:: nll:: ToRegionVid ;
3
+ use crate :: borrow_check:: path_utils:: allow_two_phase_borrow;
3
4
use crate :: dataflow:: indexes:: BorrowIndex ;
4
5
use crate :: dataflow:: move_paths:: MoveData ;
5
6
use rustc:: mir:: traversal;
@@ -299,12 +300,6 @@ impl<'a, 'gcx, 'tcx> Visitor<'tcx> for GatherBorrows<'a, 'gcx, 'tcx> {
299
300
}
300
301
301
302
impl < ' 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
- }
308
303
309
304
/// If this is a two-phase borrow, then we will record it
310
305
/// as "pending" until we find the activating use.
@@ -320,7 +315,7 @@ impl<'a, 'gcx, 'tcx> GatherBorrows<'a, 'gcx, 'tcx> {
320
315
start_location, assigned_place, borrow_index,
321
316
) ;
322
317
323
- if !self . allow_two_phase_borrow ( kind) {
318
+ if !allow_two_phase_borrow ( & self . tcx , kind) {
324
319
debug ! ( " -> {:?}" , start_location) ;
325
320
return ;
326
321
}
0 commit comments