2022-10-12 11:12:19 -05:00
|
|
|
// Test for diagnostic improvement issue #75907
|
2020-09-08 17:14:09 -05:00
|
|
|
|
|
|
|
mod foo {
|
|
|
|
pub(crate) struct Foo(u8);
|
2023-01-07 19:15:28 -06:00
|
|
|
pub(crate) struct Bar(pub u8, pub(in crate::foo) u8, Foo);
|
2020-09-08 17:14:09 -05:00
|
|
|
|
|
|
|
pub(crate) fn make_bar() -> Bar {
|
|
|
|
Bar(1, 12, Foo(10))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
use foo::{make_bar, Bar, Foo};
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let Bar(x, y, Foo(z)) = make_bar();
|
2020-10-26 09:36:48 -05:00
|
|
|
//~^ ERROR cannot match against a tuple struct which contains private fields
|
|
|
|
//~| ERROR cannot match against a tuple struct which contains private fields
|
2020-09-08 17:14:09 -05:00
|
|
|
}
|