diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-05-21 15:38:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-21 15:38:08 +0200 |
| commit | af081a42473979d094f71460e3b3f5bd18c0bb08 (patch) | |
| tree | d7559111f8d7297712bfe73a57f3fc22ca4f4408 /tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs | |
| parent | c43786c9b7b8d8dcc3f9c604e0e3074c16ed69d3 (diff) | |
| parent | ed983c21842be5e84f11b745c0c04ea23baa5509 (diff) | |
| download | rust-af081a42473979d094f71460e3b3f5bd18c0bb08.tar.gz rust-af081a42473979d094f71460e3b3f5bd18c0bb08.zip | |
Rollup merge of #141267 - dianne:fix-141265, r=oli-obk
only resolve top-level guard patterns' guards once
We resolve guard patterns' guards in `resolve_pattern_inner`, so to avoid resolving them multiple times, we must avoid doing so earlier. To accomplish this, `LateResolutionVisitor::visit_pat` contains a case for guard patterns that avoids visiting their guards while walking patterns.
This PR fixes #141265, which was due to `visit::walk_pat` being used instead; this meant guards at the top level of a pattern would be visited twice. e.g. it would ICE on `for x if x in [] {}`, but not `for (x if x) in [] {}`. `visit_pat` was already used for the guard pattern in the second example, on account of the top-level pattern being parens.
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions
