From c760af1801f31ac90540719b7bbc73436e977651 Mon Sep 17 00:00:00 2001 From: dianne Date: Sun, 29 Jun 2025 21:24:25 -0700 Subject: [PATCH] update AST-to-HIR lowering examples for conditionals and loops - `for` loops now use two `match`es for all of their bindings. I'm not sure this is the most helpful way of conveying that, but it's about as informative as before while staying brief. - `while let` and `if let` don't use `match`; they use `let` expressions in their conditions. Since `if let` no longer has significantly different desugaring and having a whole bullet point for `while` would feel redundant with `for`, I've removed those examples. --- src/hir/lowering.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/hir/lowering.md b/src/hir/lowering.md index 02c69b860..c0057a69c 100644 --- a/src/hir/lowering.md +++ b/src/hir/lowering.md @@ -7,10 +7,8 @@ of such structures include but are not limited to * Parenthesis * Removed without replacement, the tree structure makes order explicit -* `for` loops and `while (let)` loops - * Converted to `loop` + `match` and some `let` bindings -* `if let` - * Converted to `match` +* `for` loops + * Converted to `match` + `loop` + `match` * Universal `impl Trait` * Converted to generic arguments (but with some flags, to know that the user didn't write them)