mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-01 00:36:54 +00:00
20 lines
507 B
Rust
20 lines
507 B
Rust
// https://github.com/rust-lang/rust/issues/76077
|
|
//@ 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
|
|
}
|