File tree 2 files changed +28
-7
lines changed
2 files changed +28
-7
lines changed Original file line number Diff line number Diff line change 1
1
#![ allow( dead_code) ]
2
2
3
3
#[ repr( align( 16.0 ) ) ] //~ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer
4
- struct A ( i32 ) ;
4
+ struct S0 ( i32 ) ;
5
5
6
6
#[ repr( align( 15 ) ) ] //~ ERROR: invalid `repr(align)` attribute: not a power of two
7
- struct B ( i32 ) ;
7
+ struct S1 ( i32 ) ;
8
8
9
9
#[ repr( align( 4294967296 ) ) ] //~ ERROR: invalid `repr(align)` attribute: larger than 2^29
10
- struct C ( i32 ) ;
10
+ struct S2 ( i32 ) ;
11
11
12
12
#[ 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 }
14
17
15
18
#[ 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 }
17
26
18
27
fn 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
16
16
LL | #[repr(align(4294967296))]
17
17
| ^^^^^^^^^^^^^^^^^
18
18
19
- error[E0589]: invalid `repr(align)` attribute: not a power of two
19
+ error[E0589]: invalid `repr(align)` attribute: not an unsuffixed integer
20
20
--> $DIR/repr-align.rs:15:8
21
21
|
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
+ |
22
28
LL | #[repr(align(15))]
23
29
| ^^^^^^^^^
24
30
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
26
38
27
39
For more information about this error, try `rustc --explain E0589`.
You can’t perform that action at this time.
0 commit comments