diff --git a/src/test/ui/repr/repr-align.rs b/src/test/ui/repr/repr-align.rs index 2e90360aff2f1..bc6a9fe562a67 100644 --- a/src/test/ui/repr/repr-align.rs +++ b/src/test/ui/repr/repr-align.rs @@ -1,18 +1,27 @@ #![allow(dead_code)] #[repr(align(16.0))] //~ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer -struct A(i32); +struct S0(i32); #[repr(align(15))] //~ ERROR: invalid `repr(align)` attribute: not a power of two -struct B(i32); +struct S1(i32); #[repr(align(4294967296))] //~ ERROR: invalid `repr(align)` attribute: larger than 2^29 -struct C(i32); +struct S2(i32); #[repr(align(536870912))] // ok: this is the largest accepted alignment -struct D(i32); +struct S3(i32); + +#[repr(align(16.0))] //~ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer +enum E0 { A, B } #[repr(align(15))] //~ ERROR: invalid `repr(align)` attribute: not a power of two -enum E { Left, Right } +enum E1 { A, B } + +#[repr(align(4294967296))] //~ ERROR: invalid `repr(align)` attribute: larger than 2^29 +enum E2 { A, B } + +#[repr(align(536870912))] // ok: this is the largest accepted alignment +enum E3 { A, B } fn main() {} diff --git a/src/test/ui/repr/repr-align.stderr b/src/test/ui/repr/repr-align.stderr index 645ed0c8ad3b1..280cab2b4a144 100644 --- a/src/test/ui/repr/repr-align.stderr +++ b/src/test/ui/repr/repr-align.stderr @@ -16,12 +16,24 @@ error[E0589]: invalid `repr(align)` attribute: larger than 2^29 LL | #[repr(align(4294967296))] | ^^^^^^^^^^^^^^^^^ -error[E0589]: invalid `repr(align)` attribute: not a power of two +error[E0589]: invalid `repr(align)` attribute: not an unsuffixed integer --> $DIR/repr-align.rs:15:8 | +LL | #[repr(align(16.0))] + | ^^^^^^^^^^^ + +error[E0589]: invalid `repr(align)` attribute: not a power of two + --> $DIR/repr-align.rs:18:8 + | LL | #[repr(align(15))] | ^^^^^^^^^ -error: aborting due to 4 previous errors +error[E0589]: invalid `repr(align)` attribute: larger than 2^29 + --> $DIR/repr-align.rs:21:8 + | +LL | #[repr(align(4294967296))] + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0589`.