File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1432,8 +1432,9 @@ fn make_child<'elve>(x: &mut &'elve isize, y: &mut &'elve isize) {
14321432"## ,
14331433
14341434E0317 : r##"
1435- An `if` expression without an `else` block is required to have the type `()`.
1436- This error occurs when the `if` block has a type other than `()`. For example:
1435+ This error occurs when an `if` expression without an `else` block is used in a
1436+ context where a type other than `()` is expected, for example a `let`
1437+ expression:
14371438
14381439```compile_fail,E0317
14391440fn main() {
@@ -1442,8 +1443,9 @@ fn main() {
14421443}
14431444```
14441445
1445- To resolve this error, either add an `else` block having the same type as the
1446- `if` block, or adjust the `if` block so that it has the type `()`.
1446+ An `if` expression without an `else` block has the type `()`, so this is a type
1447+ error. To resolve it, add an `else` block having the same type as the `if`
1448+ block.
14471449"## ,
14481450
14491451E0398 : r##"
You can’t perform that action at this time.
0 commit comments