Uh oh!
There was an error while loading. Please reload this page.
Document if-let guards - #1082
Conversation
| }; | ||
| ``` | ||
| `if let` guards are introduced by the `if let` keywords and are composed of a pattern, an `=` and a scrutinee expression. |
There was a problem hiding this comment.
| `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). |
There was a problem hiding this comment.
@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
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
commented
Aug 16, 2021
This text reads well to me. |
I think we can close this with the documentation we have currently in the reference now at time of writing |
| > `if` [_Expression_] | ||
| > | ||
| > _MatchArmIfLetGuard_:\ | ||
| > `if` `let` [_Pattern_] `=` _Scrutinee_<sub>_except lazy boolean operator expression_</sub> |
There was a problem hiding this comment.
| > `if``let`[_Pattern_]`=`_Scrutinee_<sub>_except lazy boolean operator expression_</sub> | |
| > `if``let`[_Pattern_]`=`_Scrutinee_ |
After rust#115371
rustbot
commented
Jan 31, 2025
☔ The latest upstream changes (possibly 4249fb4) made this pull request unmergeable. Please resolve the merge conflicts. |
ehuss
commented
Feb 20, 2026
Closing as superseded by #1957. |
cc @pnkfelixrust-lang/rfcs#2294rust-lang/rust#51114