rust/tests/ui/cast/cast-array-issue-138836.rs
xizheyin a34c42fefa
Expect an array when expected and acutal types are both arrays during cast
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-27 13:05:18 +08:00

6 lines
155 B
Rust

fn main() {
let a: [u8; 3] = [1,2,3];
let b = &a;
let c = b as *const [u32; 3]; //~ ERROR casting `&[u8; 3]` as `*const [u32; 3]` is invalid
}