rust/compiler/rustc_resolve/src
Matthias Krüger af081a4247
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.
2025-05-21 15:38:08 +02:00
..
late Rollup merge of #141213 - xizheyin:issue-141136, r=nnethercote 2025-05-21 11:28:45 +02:00
build_reduced_graph.rs Remove Ident::empty. 2025-05-09 13:57:49 +10:00
check_unused.rs Move ast::Item::ident into ast::ItemKind. 2025-04-01 14:08:57 +11:00
def_collector.rs Address review comments. 2025-04-01 16:07:23 +11:00
diagnostics.rs Use crate:: prefix for root macro suggestions 2025-05-17 22:01:57 +08:00
effective_visibilities.rs Move ast::Item::ident into ast::ItemKind. 2025-04-01 14:08:57 +11:00
errors.rs resolve: Support imports of associated types and glob imports from traits 2025-05-02 15:59:38 +03:00
ident.rs Avoid an empty trait name in impl blocks. 2025-04-09 15:01:14 +10:00
imports.rs resolve: Support imports of associated types and glob imports from traits 2025-05-02 15:59:38 +03:00
late.rs only resolve top-level guard patterns' guards once 2025-05-19 18:02:54 -07:00
lib.rs update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
macros.rs Remove rustc_attr_data_structures re-export from rustc_attr_parsing 2025-05-18 18:14:43 +02:00
rustdoc.rs rustc_resolve: prevent iteration of refids for completeness 2025-03-27 12:39:48 -04:00