summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-76077-1.rs
blob: 730332853c124bad17d776e1be9ec79895dbe4ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
}