Introduce guard pattern to THIR

Co-authored-by: Max Niederman <max@maxniederman.com>
This commit is contained in:
human9000
2026-03-13 18:22:43 +05:00
parent 3645249d79
commit 8a57f3d844
7 changed files with 36 additions and 1 deletions
+2 -1
View File
@@ -462,7 +462,8 @@ pub fn lower_pat(&self, pat: &'p Pat<'tcx>) -> DeconstructedPat<'p, 'tcx> {
let arity;
let fields: Vec<_>;
match &pat.kind {
PatKind::Binding { subpattern: Some(subpat), .. } => return self.lower_pat(subpat),
PatKind::Binding { subpattern: Some(subpat), .. }
| PatKind::Guard { subpattern: subpat, .. } => return self.lower_pat(subpat),
PatKind::Missing | PatKind::Binding { subpattern: None, .. } | PatKind::Wild => {
ctor = Wildcard;
fields = vec![];