]> git.proxmox.com Git - rustc.git/blame - src/test/ui/pattern/usefulness/stable-gated-fields.rs
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / pattern / usefulness / stable-gated-fields.rs
CommitLineData
5e7ed085
FG
1// aux-build:unstable.rs
2
3extern crate unstable;
4
5use unstable::UnstableStruct;
6
7fn 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}