2021-10-27 19:57:47 -05:00
|
|
|
// aux-build:hidden.rs
|
|
|
|
|
|
|
|
extern crate hidden;
|
|
|
|
|
|
|
|
use hidden::HiddenStruct;
|
|
|
|
|
2021-12-06 15:17:22 -06:00
|
|
|
struct InCrate {
|
|
|
|
a: usize,
|
|
|
|
b: bool,
|
|
|
|
#[doc(hidden)]
|
|
|
|
im_hidden: u8
|
|
|
|
}
|
|
|
|
|
2021-10-27 19:57:47 -05:00
|
|
|
fn main() {
|
2022-03-12 14:38:44 -06:00
|
|
|
let HiddenStruct { one, two } = HiddenStruct::default();
|
2021-10-27 19:57:47 -05:00
|
|
|
//~^ pattern requires `..` due to inaccessible fields
|
|
|
|
|
2022-03-12 14:38:44 -06:00
|
|
|
let HiddenStruct { one } = HiddenStruct::default();
|
2021-10-27 19:57:47 -05:00
|
|
|
//~^ pattern does not mention field `two` and inaccessible fields
|
|
|
|
|
|
|
|
let HiddenStruct { one, hide } = HiddenStruct::default();
|
|
|
|
//~^ pattern does not mention field `two`
|
2021-12-06 15:17:22 -06:00
|
|
|
|
|
|
|
let InCrate { a, b } = InCrate { a: 0, b: false, im_hidden: 0 };
|
|
|
|
//~^ pattern does not mention field `im_hidden`
|
2021-10-27 19:57:47 -05:00
|
|
|
}
|