From 3a487ea977773e11c3a9d6b3a0c965db46bfb5ec Mon Sep 17 00:00:00 2001 From: Yuki OKUSHI Date: Sun, 28 Apr 2019 19:31:54 +0900 Subject: [PATCH] Remove unnecessary function --- src/librustc_mir/borrow_check/borrow_set.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/librustc_mir/borrow_check/borrow_set.rs b/src/librustc_mir/borrow_check/borrow_set.rs index c67e2b529c9d4..c8d6ee9db6f9e 100644 --- a/src/librustc_mir/borrow_check/borrow_set.rs +++ b/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; @@ -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; }