rust/compiler/rustc_ast/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
..
attr Auto merge of #139897 - nnethercote:rm-OpenDelim-CloseDelim, r=petrochenkov 2025-04-22 01:15:06 +00:00
expand Rollup merge of #139351 - EnzymeAD:autodiff-batching2, r=oli-obk 2025-04-17 21:53:23 +02:00
util Replace rustc_lexer/unescape with rustc-literal-escaper crate 2025-04-04 14:44:45 +02:00
ast.rs Rollup merge of #140746 - dianne:guard-pat-res, r=oli-obk 2025-05-18 18:44:11 +02:00
ast_traits.rs Remove AstDeref. 2025-05-10 08:58:47 +10:00
entry.rs remove support for the #[start] attribute 2025-01-21 06:59:15 -07:00
format.rs Limit formatting width and precision to 16 bits. 2025-03-10 12:20:05 +01:00
lib.rs update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
mut_visit.rs ast: Remove token visiting from AST visitor 2025-04-30 10:36:03 +03:00
node_id.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
ptr.rs Convert some Into impls into From impls 2024-12-31 01:56:33 +00:00
token.rs Remove token::{Open,Close}Delim. 2025-04-21 07:35:56 +10:00
tokenstream.rs Use ThinVec to shrink LazyAttrTokenStreamInner. 2025-04-30 07:12:09 +10:00
visit.rs Add or-patterns to pattern types 2025-04-28 07:50:18 +00:00