Add UI test for issue 74082

This commit is contained in:
Gary Guo 2020-07-06 21:04:54 +01:00
parent 5702e0289f
commit 97867bbe5c
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,9 @@
#![allow(dead_code)]
#[repr(i128)] //~ ERROR: attribute should be applied to enum
struct Foo;
#[repr(u128)] //~ ERROR: attribute should be applied to enum
struct Bar;
fn main() {}

View File

@ -0,0 +1,19 @@
error[E0517]: attribute should be applied to enum
--> $DIR/issue-74082.rs:3:8
|
LL | #[repr(i128)]
| ^^^^
LL | struct Foo;
| ----------- not an enum
error[E0517]: attribute should be applied to enum
--> $DIR/issue-74082.rs:6:8
|
LL | #[repr(u128)]
| ^^^^
LL | struct Bar;
| ----------- not an enum
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0517`.