summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-76077-1.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/issues/issue-76077-1.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-76077-1.rs b/src/test/ui/issues/issue-76077-1.rs
new file mode 100644
index 000000000..730332853
--- /dev/null
+++ b/src/test/ui/issues/issue-76077-1.rs
@@ -0,0 +1,18 @@
+// run-rustfix
+#![allow(dead_code, unused_variables)]
+
+pub mod foo {
+ #[derive(Default)]
+ pub struct Foo { invisible: bool, }
+
+ #[derive(Default)]
+ pub struct Bar { pub visible: bool, invisible: bool, }
+}
+
+fn main() {
+ let foo::Foo {} = foo::Foo::default();
+ //~^ ERROR pattern requires `..` due to inaccessible fields
+
+ let foo::Bar { visible } = foo::Bar::default();
+ //~^ ERROR pattern requires `..` due to inaccessible fields
+}