You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/expressions/if-expr.md
+3-8Lines changed: 3 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ The syntax of an `if` expression is a sequence of one or more condition operands
35
35
followed by a consequent block, any number of `else if` conditions and blocks, and an optional trailing `else` block.
36
36
37
37
r[expr.if.condition]
38
-
Condition operands must be either an [_Expression_] with a [boolean type] or a conditional `let` match.
38
+
Condition operands must be either an [Expression] with a [boolean type] or a conditional `let` match.
39
39
40
40
r[expr.if.condition-true]
41
41
If all of the condition operands evaluate to `true` and all of the `let` patterns successfully match their [scrutinee]s,
@@ -125,7 +125,7 @@ r[expr.if.chains.intro]
125
125
Multiple condition operands can be separated with `&&`.
126
126
127
127
r[expr.if.chains.order]
128
-
Similar to a `&&`[_LazyBooleanOperatorExpression_], each operand is evaluated from left-to-right until an operand evaluates as `false` or a `let` match fails,
128
+
Similar to a `&&`[LazyBooleanExpression], each operand is evaluated from left-to-right until an operand evaluates as `false` or a `let` match fails,
129
129
in which case the subsequent operands are not evaluated.
130
130
131
131
r[expr.if.chains.bindings]
@@ -163,7 +163,7 @@ fn nested() {
163
163
```
164
164
165
165
r[expr.if.chains.or]
166
-
If any condition operand is a `let` pattern, then none of the condition operands can be a `||`[lazy boolean operator expression][_LazyBooleanOperatorExpression_] due to ambiguity and precedence with the `let` scrutinee.
166
+
If any condition operand is a `let` pattern, then none of the condition operands can be a `||`[lazy boolean operator expression][expr.bool-logic] due to ambiguity and precedence with the `let` scrutinee.
167
167
If a `||` expression is needed, then parentheses can be used. For example:
168
168
169
169
```rust
@@ -178,11 +178,6 @@ r[expr.if.edition2024]
178
178
> [!EDITION-2024]
179
179
> Before the 2024 edition, let chains are not supported. That is, the [LetChain] grammar is not allowed in an `if` expression.
Copy file name to clipboardExpand all lines: src/expressions/loop-expr.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,10 +60,10 @@ A `while` loop expression allows repeating the evaluation of a block while a set
60
60
61
61
r[expr.loop.while.syntax]
62
62
The syntax of a `while` expression is a sequence of one or more condition operands separated by `&&`,
63
-
followed by a [_BlockExpression_].
63
+
followed by a [BlockExpression].
64
64
65
65
r[expr.loop.while.condition]
66
-
Condition operands must be either an [_Expression_] with a [boolean type] or a conditional `let` match.
66
+
Condition operands must be either an [Expression] with a [boolean type] or a conditional `let` match.
67
67
If all of the condition operands evaluate to `true` and all of the `let` patterns successfully match their [scrutinee]s,
68
68
then the loop body block executes.
69
69
@@ -392,8 +392,6 @@ r[expr.loop.break-value.loop]
392
392
In the case a `loop` has an associated `break`, it is not considered diverging, and the `loop` must have a type compatible with each `break` expression.
393
393
`break` without an expression is considered identical to `break` with expression `()`.
0 commit comments