2022-06-03 08:46:22 -04:00
|
|
|
// error-pattern: type validation failed: encountered a pointer
|
2022-06-06 12:33:48 -04:00
|
|
|
// normalize-stderr-test: "\[u8; (08|16)\]" -> "$$ARRAY"
|
2017-07-12 09:29:18 +02:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
#[cfg(target_pointer_width="64")]
|
|
|
|
let bad = unsafe {
|
2018-08-14 17:19:46 +02:00
|
|
|
std::mem::transmute::<&[u8], [u8; 16]>(&[1u8])
|
2017-07-12 09:29:18 +02:00
|
|
|
};
|
|
|
|
#[cfg(target_pointer_width="32")]
|
|
|
|
let bad = unsafe {
|
2022-06-06 12:33:48 -04:00
|
|
|
std::mem::transmute::<&[u8], [u8; 08]>(&[1u8])
|
2017-07-12 09:29:18 +02:00
|
|
|
};
|
2022-06-03 08:46:22 -04:00
|
|
|
let _val = bad[0] + bad[bad.len()-1];
|
2017-07-12 09:29:18 +02:00
|
|
|
}
|