]> git.proxmox.com Git - rustc.git/blob - tests/ui/pattern/usefulness/stable-gated-fields.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / 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 }