rust/compiler/rustc_resolve
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
..
src Rollup merge of #140746 - dianne:guard-pat-res, r=oli-obk 2025-05-18 18:44:11 +02:00
Cargo.toml Suggest stable candidates rather than unstable ones 2025-05-09 22:05:59 +08:00
messages.ftl resolve: Support imports of associated types and glob imports from traits 2025-05-02 15:59:38 +03:00