about summary refs log tree commit diff
path: root/tests/ui/mir/enum/single_with_repr_ok.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/mir/enum/single_with_repr_ok.rs')
-rw-r--r--tests/ui/mir/enum/single_with_repr_ok.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/mir/enum/single_with_repr_ok.rs b/tests/ui/mir/enum/single_with_repr_ok.rs
new file mode 100644
index 00000000000..b0ed2bad660
--- /dev/null
+++ b/tests/ui/mir/enum/single_with_repr_ok.rs
@@ -0,0 +1,12 @@
+//@ run-pass
+//@ compile-flags: -C debug-assertions
+
+#[allow(dead_code)]
+#[repr(u16)]
+enum Single {
+    A
+}
+
+fn main() {
+    let _val: Single = unsafe { std::mem::transmute::<u16, Single>(0) };
+}