rust/tests/fail/provenance/strict_provenance_cast.rs

7 lines
217 B
Rust
Raw Normal View History

2022-07-08 11:08:32 -05:00
//@compile-flags: -Zmiri-strict-provenance
fn main() {
let addr = &0 as *const i32 as usize;
2022-06-28 07:52:22 -05:00
let _ptr = addr as *const i32; //~ ERROR integer-to-pointer casts and `ptr::from_exposed_addr` are not supported
}