未验证 提交 2e5f0b3c 编写于 作者: F flip1995

Remove unused TyCtxt argument from allow_two_phase_borrow function

上级 86ed3116
......@@ -315,7 +315,7 @@ fn insert_as_pending_if_two_phase(
start_location, assigned_place, borrow_index,
);
if !allow_two_phase_borrow(self.tcx, kind) {
if !allow_two_phase_borrow(kind) {
debug!(" -> {:?}", start_location);
return;
}
......
......@@ -1076,7 +1076,7 @@ fn check_access_for_conflict(
(Read(kind), BorrowKind::Unique) | (Read(kind), BorrowKind::Mut { .. }) => {
// Reading from mere reservations of mutable-borrows is OK.
if !is_active(&this.dominators, borrow, context.loc) {
assert!(allow_two_phase_borrow(tcx, borrow.kind));
assert!(allow_two_phase_borrow(borrow.kind));
return Control::Continue;
}
......@@ -1233,7 +1233,7 @@ fn consume_rvalue(
BorrowKind::Shared => (Deep, Read(ReadKind::Borrow(bk))),
BorrowKind::Unique | BorrowKind::Mut { .. } => {
let wk = WriteKind::MutableBorrow(bk);
if allow_two_phase_borrow(self.infcx.tcx, bk) {
if allow_two_phase_borrow(bk) {
(Deep, Reservation(wk))
} else {
(Deep, Write(wk))
......
......@@ -321,7 +321,7 @@ fn consume_rvalue(
BorrowKind::Shared => (Deep, Read(ReadKind::Borrow(bk))),
BorrowKind::Unique | BorrowKind::Mut { .. } => {
let wk = WriteKind::MutableBorrow(bk);
if allow_two_phase_borrow(self.tcx, bk) {
if allow_two_phase_borrow(bk) {
(Deep, Reservation(wk))
} else {
(Deep, Write(wk))
......@@ -439,7 +439,7 @@ fn check_access_for_conflict(
// Reading from mere reservations of mutable-borrows is OK.
if !is_active(&this.dominators, borrow, context.loc) {
// If the borrow isn't active yet, reads don't invalidate it
assert!(allow_two_phase_borrow(this.tcx, borrow.kind));
assert!(allow_two_phase_borrow(borrow.kind));
return Control::Continue;
}
......
......@@ -11,10 +11,7 @@
/// Returns `true` if the borrow represented by `kind` is
/// allowed to be split into separate Reservation and
/// Activation phases.
pub(super) fn allow_two_phase_borrow<'a, 'tcx, 'gcx: 'tcx>(
_tcx: TyCtxt<'a, 'gcx, 'tcx>,
kind: BorrowKind
) -> bool {
pub(super) fn allow_two_phase_borrow<'a, 'tcx, 'gcx: 'tcx>(kind: BorrowKind) -> bool {
kind.allows_two_phase_borrow()
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册