2024-02-16 20:02:50 +00:00
|
|
|
//@ run-fail
|
|
|
|
//@ 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
|
2022-11-10 11:37:28 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut x = [0u32; 2];
|
2023-07-04 14:23:16 -04:00
|
|
|
let ptr = x.as_mut_ptr();
|
2022-11-10 11:37:28 -05:00
|
|
|
unsafe {
|
2023-07-04 14:23:16 -04:00
|
|
|
*(ptr.byte_add(1)) = 42;
|
2022-11-10 11:37:28 -05:00
|
|
|
}
|
|
|
|
}
|