Skip to content

Commit e03255d

Browse files
committed
fix existing tests
fix thread-local example to no longer write to pointers derived from a shared ref; fix compile-fail test
1 parent 0c70415 commit e03255d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tests/compile-fail/modifying_constants.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// This should fail even without validation
2+
// compile-flags: -Zmiri-disable-validation
13

24
fn main() {
35
let x = &1; // the `&1` is promoted to a constant, but it used to be that only the pointer is marked static, not the pointee

tests/run-pass/thread-local.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fn main() {
5656
create(None); // check that the no-dtor case works
5757

5858
// Initialize the keys we use to check destructor ordering
59-
for (key, global) in KEYS.iter_mut().zip(GLOBALS.iter()) {
59+
for (key, global) in KEYS.iter_mut().zip(GLOBALS.iter_mut()) {
6060
*key = create(Some(mem::transmute(dtor as unsafe extern fn(*mut u64))));
6161
set(*key, global as *const _ as *mut _);
6262
}

0 commit comments

Comments
 (0)