Skip to content

Commit ec3175e

Browse files
committed
Adjust tests for newly uplifted cast_ref_to_mut lint
1 parent 15c9cdb commit ec3175e

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

tests/fail/modifying_constants.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// This should fail even without validation/SB
22
//@compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
33

4+
#![allow(cast_ref_to_mut)]
5+
46
fn main() {
57
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
68
let y = unsafe { &mut *(x as *const i32 as *mut i32) };

tests/fail/stacked_borrows/shr_frozen_violation1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(cast_ref_to_mut)]
2+
13
fn foo(x: &mut i32) -> i32 {
24
*x = 5;
35
unknown_code(&*x);

0 commit comments

Comments
 (0)