diff options
| author | dianne <diannes.gm@gmail.com> | 2025-06-29 21:24:25 -0700 |
|---|---|---|
| committer | dianne <diannes.gm@gmail.com> | 2025-06-29 21:25:53 -0700 |
| commit | 390d1be1c7eb500672f9c982e7de13ed27506aea (patch) | |
| tree | 4d38631cdace8d252671f08cb165199aaadead8c | |
| parent | 56283410f26472ec72a6673a1cbb2d8c4efdff15 (diff) | |
| download | rust-390d1be1c7eb500672f9c982e7de13ed27506aea.tar.gz rust-390d1be1c7eb500672f9c982e7de13ed27506aea.zip | |
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.
| -rw-r--r-- | src/doc/rustc-dev-guide/src/hir/lowering.md | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/doc/rustc-dev-guide/src/hir/lowering.md b/src/doc/rustc-dev-guide/src/hir/lowering.md index 02c69b8609f..c0057a69c10 100644 --- a/src/doc/rustc-dev-guide/src/hir/lowering.md +++ b/src/doc/rustc-dev-guide/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) |
