mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 20:46:07 +03:00
Remove unused TyCtxt argument from allow_two_phase_borrow function
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user