1
Fork 0

Rollup merge of #139035 - nnethercote:PatKind-Missing, r=oli-obk

Add new `PatKind::Missing` variants

To avoid some ugly uses of `kw::Empty` when handling "missing" patterns, e.g. in bare fn tys. Helps with #137978. Details in the individual commits.

r? ``@oli-obk``
This commit is contained in:
Stuart Cook 2025-04-07 22:29:17 +10:00 committed by GitHub
commit 82df6229b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 92 additions and 66 deletions

View file

@ -460,7 +460,7 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> {
PatKind::AscribeUserType { subpattern, .. }
| PatKind::ExpandedConstant { subpattern, .. } => return self.lower_pat(subpattern),
PatKind::Binding { subpattern: Some(subpat), .. } => return self.lower_pat(subpat),
PatKind::Binding { subpattern: None, .. } | PatKind::Wild => {
PatKind::Missing | PatKind::Binding { subpattern: None, .. } | PatKind::Wild => {
ctor = Wildcard;
fields = vec![];
arity = 0;