We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3bf0655 + afe4262 commit bc969f1Copy full SHA for bc969f1
tests/run-pass/intptrcast.rs
@@ -1,9 +1,14 @@
1
// compile-flags: -Zmiri-seed=0000000000000000
2
3
fn main() {
4
+ // Some casting-to-int with arithmetic.
5
let x = &42 as *const i32 as usize;
6
let y = x * 2;
7
assert_eq!(y, x + x);
8
let z = y as u8 as usize;
9
assert_eq!(z, y % 256);
10
+
11
+ // Pointer string formatting! We can't check the output as it changes when libstd changes,
12
+ // but we can make sure Miri does not error.
13
+ format!("{:?}", &mut 13 as *mut _);
14
}
0 commit comments