File tree Expand file tree Collapse file tree 2 files changed +28
-7
lines changed Expand file tree Collapse file tree 2 files changed +28
-7
lines changed Original file line number Diff line number Diff line change 11#![ allow( dead_code) ]
22
33#[ repr( align( 16.0 ) ) ] //~ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer
4- struct A ( i32 ) ;
4+ struct S0 ( i32 ) ;
55
66#[ repr( align( 15 ) ) ] //~ ERROR: invalid `repr(align)` attribute: not a power of two
7- struct B ( i32 ) ;
7+ struct S1 ( i32 ) ;
88
99#[ repr( align( 4294967296 ) ) ] //~ ERROR: invalid `repr(align)` attribute: larger than 2^29
10- struct C ( i32 ) ;
10+ struct S2 ( i32 ) ;
1111
1212#[ repr( align( 536870912 ) ) ] // ok: this is the largest accepted alignment
13- struct D ( i32 ) ;
13+ struct S3 ( i32 ) ;
14+
15+ #[ repr( align( 16.0 ) ) ] //~ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer
16+ enum E0 { A , B }
1417
1518#[ repr( align( 15 ) ) ] //~ ERROR: invalid `repr(align)` attribute: not a power of two
16- enum E { Left , Right }
19+ enum E1 { A , B }
20+
21+ #[ repr( align( 4294967296 ) ) ] //~ ERROR: invalid `repr(align)` attribute: larger than 2^29
22+ enum E2 { A , B }
23+
24+ #[ repr( align( 536870912 ) ) ] // ok: this is the largest accepted alignment
25+ enum E3 { A , B }
1726
1827fn main ( ) { }
Original file line number Diff line number Diff line change @@ -16,12 +16,24 @@ error[E0589]: invalid `repr(align)` attribute: larger than 2^29
1616LL | #[repr(align(4294967296))]
1717 | ^^^^^^^^^^^^^^^^^
1818
19- error[E0589]: invalid `repr(align)` attribute: not a power of two
19+ error[E0589]: invalid `repr(align)` attribute: not an unsuffixed integer
2020 --> $DIR/repr-align.rs:15:8
2121 |
22+ LL | #[repr(align(16.0))]
23+ | ^^^^^^^^^^^
24+
25+ error[E0589]: invalid `repr(align)` attribute: not a power of two
26+ --> $DIR/repr-align.rs:18:8
27+ |
2228LL | #[repr(align(15))]
2329 | ^^^^^^^^^
2430
25- error: aborting due to 4 previous errors
31+ error[E0589]: invalid `repr(align)` attribute: larger than 2^29
32+ --> $DIR/repr-align.rs:21:8
33+ |
34+ LL | #[repr(align(4294967296))]
35+ | ^^^^^^^^^^^^^^^^^
36+
37+ error: aborting due to 6 previous errors
2638
2739For more information about this error, try `rustc --explain E0589`.
You can’t perform that action at this time.
0 commit comments