Skip to content

update AST-to-HIR lowering examples for conditionals and loops #2485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 30, 2025

Conversation

dianne
Copy link
Contributor

@dianne dianne commented Jun 30, 2025

  • for loops now use two matches 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. I'd be happy to make this clearer, if anyone has ideas.
  • while let and if let don't use match; they use let expressions in their conditions. Since if let no longer has a significantly different desugaring and having a whole bullet point for while would feel redundant with for, I've removed those examples.

- `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.
@rustbot
Copy link
Collaborator

rustbot commented Jun 30, 2025

Thanks for the PR. If you have write access, feel free to merge this PR if it does not need reviews. You can request a review using r? rustc-dev-guide or r? <username>.

@rustbot rustbot added the S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content label Jun 30, 2025
@dianne
Copy link
Contributor Author

dianne commented Jun 30, 2025

r? rustc-dev-guide

@Noratrieb Noratrieb merged commit 40a2556 into rust-lang:master Jun 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants