]> git.lizzy.rs Git - rust.git/blob - src/test/ui/pattern/usefulness/stable-gated-fields.rs
Auto merge of #98526 - jyn514:download-llvm-outside-checkout, r=Mark-Simulacrum
[rust.git] / src / test / ui / pattern / usefulness / stable-gated-fields.rs
1 // aux-build:unstable.rs
2
3 extern crate unstable;
4
5 use unstable::UnstableStruct;
6
7 fn main() {
8     let UnstableStruct { stable } = UnstableStruct::default();
9     //~^ pattern does not mention field `stable2` and inaccessible fields
10
11     let UnstableStruct { stable, stable2 } = UnstableStruct::default();
12     //~^ pattern requires `..` due to inaccessible fields
13
14     // OK: stable field is matched
15     let UnstableStruct { stable, stable2, .. } = UnstableStruct::default();
16 }