start_location, assigned_place, borrow_index,
);
- if !allow_two_phase_borrow(self.tcx, kind) {
+ if !allow_two_phase_borrow(kind) {
debug!(" -> {:?}", start_location);
return;
}
(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;
}
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))
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))
// 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;
}
/// 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()
}