diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-12-08 17:18:50 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-08 17:18:50 +0100 |
| commit | 1868c8f66f25c3493b26f23e36a861328cdedbdb (patch) | |
| tree | e63475b9961590dbeb0524784d5f753160e945dd /compiler/rustc_ast/src/mut_visit.rs | |
| parent | f33a8c6426074b7ce8d08740e9805fdca96ee150 (diff) | |
| parent | 2459dbb4bad87c38284b0a2ba4f2d6d37db99627 (diff) | |
| download | rust-1868c8f66f25c3493b26f23e36a861328cdedbdb.tar.gz rust-1868c8f66f25c3493b26f23e36a861328cdedbdb.zip | |
Rollup merge of #133424 - Nadrieril:guard-patterns-parsing, r=fee1-dead
Parse guard patterns This implements the parsing of [RFC3637 Guard Patterns](https://rust-lang.github.io/rfcs/3637-guard-patterns.html) (see also [tracking issue](https://github.com/rust-lang/rust/issues/129967)). This PR is extracted from https://github.com/rust-lang/rust/pull/129996 with minor modifications. cc `@max-niederman`
Diffstat (limited to 'compiler/rustc_ast/src/mut_visit.rs')
| -rw-r--r-- | compiler/rustc_ast/src/mut_visit.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_ast/src/mut_visit.rs b/compiler/rustc_ast/src/mut_visit.rs index 622c260868e..3a4a8ce266e 100644 --- a/compiler/rustc_ast/src/mut_visit.rs +++ b/compiler/rustc_ast/src/mut_visit.rs @@ -1525,6 +1525,10 @@ pub fn walk_pat<T: MutVisitor>(vis: &mut T, pat: &mut P<Pat>) { visit_opt(e2, |e| vis.visit_expr(e)); vis.visit_span(span); } + PatKind::Guard(p, e) => { + vis.visit_pat(p); + vis.visit_expr(e); + } PatKind::Tuple(elems) | PatKind::Slice(elems) | PatKind::Or(elems) => { visit_thin_vec(elems, |elem| vis.visit_pat(elem)) } |
