Skip to content

Commit

Permalink
assert some sense
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Nov 28, 2018
1 parent 1de7d2f commit 2a27d08
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/stacked_borrows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,7 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for MiriEvalContext<'a, 'mir, 'tcx> {
let new_place = place.with_tag(new_bor);
// Handle two-phase borrows.
if two_phase {
assert!(mutbl == MutMutable, "two-phase shared borrows make no sense");
// We immediately share it, to allow read accesses
let two_phase_time = self.machine.stacked_borrows.increment_clock();
let two_phase_bor = Borrow::Shr(Some(two_phase_time));
Expand Down

0 comments on commit 2a27d08

Please sign in to comment.