rust/tests/ui/issues/issue-76077-1.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
456 B
Rust
Raw Normal View History

// 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
}