Skip to content

Commit

Permalink
Remove unnecessary function
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Apr 28, 2019
1 parent 542357f commit 3a487ea
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/librustc_mir/borrow_check/borrow_set.rs
@@ -1,5 +1,6 @@
use crate::borrow_check::place_ext::PlaceExt;
use crate::borrow_check::nll::ToRegionVid;
use crate::borrow_check::path_utils::allow_two_phase_borrow;
use crate::dataflow::indexes::BorrowIndex;
use crate::dataflow::move_paths::MoveData;
use rustc::mir::traversal;
Expand Down Expand Up @@ -299,12 +300,6 @@ impl<'a, 'gcx, 'tcx> Visitor<'tcx> for GatherBorrows<'a, 'gcx, 'tcx> {
}

impl<'a, 'gcx, 'tcx> GatherBorrows<'a, 'gcx, 'tcx> {
/// Returns `true` if the borrow represented by `kind` is
/// allowed to be split into separate Reservation and
/// Activation phases.
fn allow_two_phase_borrow(&self, kind: mir::BorrowKind) -> bool {
kind.allows_two_phase_borrow()
}

/// If this is a two-phase borrow, then we will record it
/// as "pending" until we find the activating use.
Expand All @@ -320,7 +315,7 @@ impl<'a, 'gcx, 'tcx> GatherBorrows<'a, 'gcx, 'tcx> {
start_location, assigned_place, borrow_index,
);

if !self.allow_two_phase_borrow(kind) {
if !allow_two_phase_borrow(&self.tcx, kind) {
debug!(" -> {:?}", start_location);
return;
}
Expand Down

0 comments on commit 3a487ea

Please sign in to comment.