rust/tests/ui/layout/thaw-validate-invalid-enum.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
308 B
Rust
Raw Normal View History

2024-08-15 22:44:16 +02:00
//@ compile-flags: -Zvalidate-mir
#[repr(packed)] //~ ERROR: attribute should be applied to a struct
2024-08-15 22:44:16 +02:00
#[repr(u32)]
enum E {
A,
B,
C,
}
fn main() {
union InvalidTag {
int: u32,
e: E, //~ ERROR: field must implement `Copy`
2024-08-15 22:44:16 +02:00
}
let _invalid_tag = InvalidTag { int: 4 };
}