]> git.lizzy.rs Git - rust.git/commitdiff
Add UI test for issue 74082
authorGary Guo <gary@garyguo.net>
Mon, 6 Jul 2020 20:04:54 +0000 (21:04 +0100)
committerGary Guo <gary@garyguo.net>
Mon, 6 Jul 2020 20:04:54 +0000 (21:04 +0100)
src/test/ui/issues/issue-74082.rs [new file with mode: 0644]
src/test/ui/issues/issue-74082.stderr [new file with mode: 0644]

diff --git a/src/test/ui/issues/issue-74082.rs b/src/test/ui/issues/issue-74082.rs
new file mode 100644 (file)
index 0000000..982f8ef
--- /dev/null
@@ -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 (file)
index 0000000..08fe415
--- /dev/null
@@ -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`.