mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 18:23:49 +00:00
14 lines
351 B
Rust
14 lines
351 B
Rust
//@ run-fail
|
|
//@ ignore-wasm32-bare: No panic messages
|
|
//@ ignore-i686-pc-windows-msvc: #112480
|
|
//@ compile-flags: -C debug-assertions
|
|
//@ error-pattern: misaligned pointer dereference: address must be a multiple of 0x4 but is
|
|
|
|
fn main() {
|
|
let mut x = [0u32; 2];
|
|
let ptr = x.as_mut_ptr();
|
|
unsafe {
|
|
*(ptr.byte_add(1)) = 42;
|
|
}
|
|
}
|