Skip to content

Commit 60e26af

Browse files
committed
add a sanity assertion
1 parent cf17462 commit 60e26af

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/stacked_borrows.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ impl<'tcx> Stacks {
318318
new_bor: Borrow,
319319
new_kind: RefKind,
320320
) -> EvalResult<'tcx> {
321+
assert_eq!(new_bor.is_unique(), new_kind == RefKind::Unique);
321322
trace!("reborrow for tag {:?} to {:?} as {:?}: {:?}, size {}",
322323
ptr.tag, new_bor, new_kind, ptr, size.bytes());
323324
let mut stacks = self.stacks.borrow_mut();

0 commit comments

Comments
 (0)