1
Fork 0

Remove unnecessary function

This commit is contained in:
Yuki OKUSHI 2019-04-28 19:31:54 +09:00
parent 542357f52a
commit 3a487ea977

View file

@ -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;
@ -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.
@ -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;
}