From 97867bbe5cd09df7754864c826f58d3029f4422e Mon Sep 17 00:00:00 2001 From: Gary Guo Date: Mon, 6 Jul 2020 21:04:54 +0100 Subject: [PATCH] Add UI test for issue 74082 --- src/test/ui/issues/issue-74082.rs | 9 +++++++++ src/test/ui/issues/issue-74082.stderr | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/test/ui/issues/issue-74082.rs create mode 100644 src/test/ui/issues/issue-74082.stderr diff --git a/src/test/ui/issues/issue-74082.rs b/src/test/ui/issues/issue-74082.rs new file mode 100644 index 0000000000000..982f8ef02538b --- /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 0000000000000..08fe415513d0d --- /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`.