diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/layout/struct.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/layout/struct.rs b/tests/ui/layout/struct.rs new file mode 100644 index 000000000..e74cf5a95 --- /dev/null +++ b/tests/ui/layout/struct.rs @@ -0,0 +1,12 @@ +// normalize-stderr-test "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN" +//! Various struct layout tests. + +#![feature(rustc_attrs)] +#![feature(never_type)] +#![crate_type = "lib"] + +#[rustc_layout(abi)] +struct AlignedZstPreventsScalar(i16, [i32; 0]); //~ERROR: abi: Aggregate + +#[rustc_layout(abi)] +struct AlignedZstButStillScalar(i32, [i16; 0]); //~ERROR: abi: Scalar |