about summary refs log tree commit diff
path: root/tests/ui/mir/alignment/misaligned_borrow.rs
blob: 60c21deaba5ab9e732eb36db099f0e4eefca2027 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
//@ run-crash
//@ 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 x = [0u32; 2];
    let ptr = x.as_ptr();
    unsafe {
        let _ptr = &(*(ptr.byte_add(1)));
    }
}