Skip to content

Commit 84de041

Browse files
committed
add test for invalid places of repr align
1 parent dda8994 commit 84de041

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

tests/ui/attributes/invalid-repr.rs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#[repr(align(16))]
2+
//~^ ERROR attribute should be applied to a struct, enum, function, associated function, or union
3+
pub type Foo = i32;
4+
5+
fn main() {}
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0517]: attribute should be applied to a struct, enum, function, associated function, or union
2+
--> $DIR/invalid-repr.rs:1:8
3+
|
4+
LL | #[repr(align(16))]
5+
| ^^^^^^^^^
6+
LL |
7+
LL | pub type Foo = i32;
8+
| ------------------- not a struct, enum, function, associated function, or union
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0517`.

0 commit comments

Comments
 (0)