remove allow_two_phase_borrow
it's been simplified over the years, but now it's no longer useful. - document its replacement in `BorrowKind` - use that everywhere instead
This commit is contained in:
@@ -1076,7 +1076,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
|
||||
(Read(kind), BorrowKind::Mut { .. }) => {
|
||||
// Reading from mere reservations of mutable-borrows is OK.
|
||||
if !is_active(this.dominators(), borrow, location) {
|
||||
assert!(allow_two_phase_borrow(borrow.kind));
|
||||
assert!(borrow.kind.allows_two_phase_borrow());
|
||||
return Control::Continue;
|
||||
}
|
||||
|
||||
@@ -1184,7 +1184,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
|
||||
}
|
||||
BorrowKind::Mut { .. } => {
|
||||
let wk = WriteKind::MutableBorrow(bk);
|
||||
if allow_two_phase_borrow(bk) {
|
||||
if bk.allows_two_phase_borrow() {
|
||||
(Deep, Reservation(wk))
|
||||
} else {
|
||||
(Deep, Write(wk))
|
||||
|
||||
Reference in New Issue
Block a user