Skip to content

Commit 3a487ea

Browse files
committed
Remove unnecessary function
1 parent 542357f commit 3a487ea

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/librustc_mir/borrow_check/borrow_set.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use crate::borrow_check::place_ext::PlaceExt;
22
use crate::borrow_check::nll::ToRegionVid;
3+
use crate::borrow_check::path_utils::allow_two_phase_borrow;
34
use crate::dataflow::indexes::BorrowIndex;
45
use crate::dataflow::move_paths::MoveData;
56
use rustc::mir::traversal;
@@ -299,12 +300,6 @@ impl<'a, 'gcx, 'tcx> Visitor<'tcx> for GatherBorrows<'a, 'gcx, 'tcx> {
299300
}
300301

301302
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-
}
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

Comments
 (0)