Skip to content

Commit 70a5bb7

Browse files
committed
force pointers before reborrowing; fixes cargo miri test suite
1 parent a6f9bbc commit 70a5bb7

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

src/helpers.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
116116
.map(|(size, _)| size)
117117
.unwrap_or_else(|| place.layout.size)
118118
);
119-
let place = this.normalize_mplace_ptr(place)?;
120119
// Store how far we proceeded into the place so far. Everything to the left of
121120
// this offset has already been handled, in the sense that the frozen parts
122121
// have had `action` called on them.

src/stacked_borrows.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,7 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
587587
// Nothing to do for ZSTs.
588588
return Ok(*val);
589589
}
590+
let place = this.force_mplace_ptr(place)?;
590591

591592
// Compute new borrow.
592593
let new_tag = match kind {

test-cargo-miri/run-test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ def test_cargo_miri_run():
5252
)
5353

5454
def test_cargo_miri_test():
55-
# FIXME: enable validation again, once that no longer conflicts with intptrcast
5655
test("cargo miri test",
57-
cargo_miri("test") + ["--", "-Zmiri-seed=feed", "-Zmiri-disable-validation"],
56+
cargo_miri("test") + ["--", "-Zmiri-seed=feed"],
5857
"test.stdout.ref", "test.stderr.ref"
5958
)
6059
test("cargo miri test (with filter)",

tests/run-pass/unique-send.rs renamed to tests/run-pass/mpsc.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@ pub fn main() {
77
tx.send(box 100).unwrap();
88
let v = rx.recv().unwrap();
99
assert_eq!(v, box 100);
10+
11+
tx.send(box 101).unwrap();
12+
tx.send(box 102).unwrap();
13+
assert_eq!(rx.recv().unwrap(), box 101);
14+
assert_eq!(rx.recv().unwrap(), box 102);
1015
}

0 commit comments

Comments
 (0)