about summary refs log tree commit diff
path: root/tests/ui/cast/array-field-ptr-cast-14845.rs
blob: 9d2da0c8932dde838b2a46b6d7159e2d52c1f792 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Regression test for https://github.com/rust-lang/rust/issues/14845

struct X {
    a: [u8; 1]
}

fn main() {
    let x = X { a: [0] };
    let _f = &x.a as *mut u8; //~ ERROR casting

    let local: [u8; 1] = [0];
    let _v = &local as *mut u8; //~ ERROR casting
}