diff options
| author | Gary Guo <gary@garyguo.net> | 2020-07-06 21:04:54 +0100 |
|---|---|---|
| committer | Gary Guo <gary@garyguo.net> | 2020-07-06 21:04:54 +0100 |
| commit | 97867bbe5cd09df7754864c826f58d3029f4422e (patch) | |
| tree | e83b2a6fd926c227cb064e6b138d34c40b9f7a1f | |
| parent | 5702e0289f7d19f0ea133d43da7dcd7cbfc5b557 (diff) | |
| download | rust-97867bbe5cd09df7754864c826f58d3029f4422e.tar.gz rust-97867bbe5cd09df7754864c826f58d3029f4422e.zip | |
Add UI test for issue 74082
| -rw-r--r-- | src/test/ui/issues/issue-74082.rs | 9 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-74082.stderr | 19 |
2 files changed, 28 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-74082.rs b/src/test/ui/issues/issue-74082.rs new file mode 100644 index 00000000000..982f8ef0253 --- /dev/null +++ b/src/test/ui/issues/issue-74082.rs @@ -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() {} diff --git a/src/test/ui/issues/issue-74082.stderr b/src/test/ui/issues/issue-74082.stderr new file mode 100644 index 00000000000..08fe415513d --- /dev/null +++ b/src/test/ui/issues/issue-74082.stderr @@ -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`. |
