-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
28 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters