rust/compiler/rustc_resolve/src
León Orell Valerian Liehr 4e5b1aa055
Rollup merge of #140746 - dianne:guard-pat-res, r=oli-obk
name resolution for guard patterns

This PR provides an initial implementation of name resolution for guard patterns [(RFC 3637)](https://github.com/rust-lang/rfcs/blob/master/text/3637-guard-patterns.md). This does not change the requirement that the bindings on either side of an or-pattern must be the same [(proposal here)](https://github.com/rust-lang/rfcs/blob/master/text/3637-guard-patterns.md#allowing-mismatching-bindings-when-possible); the code that handles that is separate from what this PR touches, so I'm saving it for a follow-up.

On a technical level, this separates "collecting the bindings in a pattern" (which was already done for or-patterns) from "introducing those bindings into scope". I believe the approach used here can be extended straightforwardly in the future to work with `if let` guard patterns, but I haven't tried it myself since we don't allow those yet.

Tracking issue for guard patterns: #129967

cc ``@Nadrieril``
2025-05-18 18:44:11 +02:00
..
late Suggest stable candidates rather than unstable ones 2025-05-09 22:05:59 +08: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 name resolution for guard patterns 2025-05-18 04:21:57 -07:00
lib.rs update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
macros.rs Remove #[rustc_macro_edition_2021]. 2025-04-20 11:15:46 +02:00
rustdoc.rs rustc_resolve: prevent iteration of refids for completeness 2025-03-27 12:39:48 -04:00