about summary refs log tree commit diff
path: root/tests/ui/simd/repr-simd-on-enum.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/simd/repr-simd-on-enum.rs')
-rw-r--r--tests/ui/simd/repr-simd-on-enum.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/simd/repr-simd-on-enum.rs b/tests/ui/simd/repr-simd-on-enum.rs
new file mode 100644
index 00000000000..49cf9e92d36
--- /dev/null
+++ b/tests/ui/simd/repr-simd-on-enum.rs
@@ -0,0 +1,15 @@
+// Used to ICE; see <https://github.com/rust-lang/rust/issues/121097>
+
+#![feature(repr_simd)]
+
+#[repr(simd)] //~ ERROR attribute should be applied to a struct
+enum Aligned {
+    Zero = 0,
+    One = 1,
+}
+
+fn tou8(al: Aligned) -> u8 {
+    al as u8
+}
+
+fn main() {}