From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/issues/issue-76077-1.fixed | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/ui/issues/issue-76077-1.fixed (limited to 'tests/ui/issues/issue-76077-1.fixed') diff --git a/tests/ui/issues/issue-76077-1.fixed b/tests/ui/issues/issue-76077-1.fixed new file mode 100644 index 000000000..8103a7ca4 --- /dev/null +++ b/tests/ui/issues/issue-76077-1.fixed @@ -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 +} -- cgit v1.2.3