Skip to content

Commit 1a7fb7e

Browse files
committed
expand comment about incomplete support for interior mutability
1 parent 0b22a1c commit 1a7fb7e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/stacked_borrows.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,12 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for super::MiriEvalContext<'a, 'mir, '
264264
borrow_kind: Option<mir::BorrowKind>,
265265
) -> EvalResult<'tcx, Borrow> {
266266
let time = self.machine.stacked_borrows.increment_clock();
267-
// FIXME This does not do enough checking when only part of the data has
268-
// interior mutability.
269267
let new_bor = match borrow_kind {
270268
Some(mir::BorrowKind::Mut { .. }) => Borrow::Mut(Mut::Uniq(time)),
271269
Some(_) =>
270+
// FIXME This does not do enough checking when only part of the data has
271+
// interior mutability. When the type is `(i32, Cell<i32>)`, we want the
272+
// first field to be frozen but not the second.
272273
if self.type_is_freeze(pointee_ty) {
273274
Borrow::Frz(time)
274275
} else {

0 commit comments

Comments
 (0)