summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/issue-64506.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/issue-64506.rs')
-rw-r--r--tests/ui/consts/issue-64506.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/consts/issue-64506.rs b/tests/ui/consts/issue-64506.rs
new file mode 100644
index 000000000..db3e85a7b
--- /dev/null
+++ b/tests/ui/consts/issue-64506.rs
@@ -0,0 +1,20 @@
+// check-pass
+
+#[derive(Copy, Clone)]
+pub struct ChildStdin {
+ inner: AnonPipe,
+}
+
+#[derive(Copy, Clone)]
+enum AnonPipe {}
+
+const FOO: () = {
+ union Foo {
+ a: ChildStdin,
+ b: (),
+ }
+ let x = unsafe { Foo { b: () }.a };
+ let x = &x.inner;
+};
+
+fn main() {}