Skip to content

Comments

Document if-let guards#1082

Closed
LeSeulArtichaut wants to merge 1 commit intorust-lang:masterfrom
LeSeulArtichaut:if-let-guards
Closed

Document if-let guards#1082
LeSeulArtichaut wants to merge 1 commit intorust-lang:masterfrom
LeSeulArtichaut:if-let-guards

Conversation

@LeSeulArtichaut
Copy link

@ehuss ehuss added the S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository label Aug 12, 2021
};
```

`if let` guards are introduced by the `if let` keywords and are composed of a pattern, an `=` and a scrutinee expression.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`if let` guards are introduced by the `if let` keywords and are composed of a pattern, an `=` and a scrutinee expression.
`if let` guards are composed following [The Rust Reference `if let` keywords syntax](https://doc.rust-lang.org/stable/reference/expressions/if-expr.html#if-let-expressions).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kw-fn, I think the original is correct here, as it is just describing the syntax, and is a style used throughout the reference as a way to anchor the description of what the text is talking about. Also, we do not use external links, or refer to the reference by name within itself.

@ehuss
Copy link
Contributor

ehuss commented Aug 15, 2021

Thanks @LeSeulArtichaut, this looks good to me! It will need to wait for it to be stabilized on nightly, though happy to discuss any feedback from the lang team in the meantime.

@Fishrock123
Copy link

This text reads well to me.

@ghost
Copy link

ghost commented Dec 9, 2022

I think we can close this with the documentation we have currently in the reference now at time of writing

>    `if` [_Expression_]
>
> _MatchArmIfLetGuard_:\
> &nbsp;&nbsp; `if` `let` [_Pattern_] `=` _Scrutinee_<sub>_except lazy boolean operator expression_</sub>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> &nbsp;&nbsp; `if` `let` [_Pattern_] `=` _Scrutinee_<sub>_except lazy boolean operator expression_</sub>
> &nbsp;&nbsp; `if` `let` [_Pattern_] `=` _Scrutinee_

After rust#115371

@ehuss ehuss added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Dec 5, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jan 31, 2025

☔ The latest upstream changes (possibly 4249fb4) made this pull request unmergeable. Please resolve the merge conflicts.

@ehuss
Copy link
Contributor

ehuss commented Feb 20, 2026

Closing as superseded by #1957.

@ehuss ehuss closed this Feb 20, 2026
@rustbot rustbot removed the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants