Skip to content

Commit 2a27d08

Browse files
committed
assert some sense
1 parent 1de7d2f commit 2a27d08

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/stacked_borrows.rs

+1
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,7 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for MiriEvalContext<'a, 'mir, 'tcx> {
699699
let new_place = place.with_tag(new_bor);
700700
// Handle two-phase borrows.
701701
if two_phase {
702+
assert!(mutbl == MutMutable, "two-phase shared borrows make no sense");
702703
// We immediately share it, to allow read accesses
703704
let two_phase_time = self.machine.stacked_borrows.increment_clock();
704705
let two_phase_bor = Borrow::Shr(Some(two_phase_time));

0 commit comments

Comments
 (0)