2022-10-12 16:12:19 +00:00
|
|
|
// Test for diagnostic improvement issue #75907
|
2020-09-08 22:14:09 +00:00
|
|
|
|
|
|
|
mod foo {
|
|
|
|
pub(crate) struct Foo(u8);
|
2023-01-08 01:15:28 +00:00
|
|
|
pub(crate) struct Bar(pub u8, pub(in crate::foo) u8, Foo);
|
2020-09-08 22:14:09 +00: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 14:36:48 +00: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 22:14:09 +00:00
|
|
|
}
|