]> git.lizzy.rs Git - rust.git/blob - src/test/ui/if/if-without-else-result.stderr
Auto merge of #59240 - euclio:struct-field-span, r=oli-obk
[rust.git] / src / test / ui / if / if-without-else-result.stderr
1 error[E0317]: if may be missing an else clause
2   --> $DIR/if-without-else-result.rs:2:13
3    |
4 LL |     let a = if true { true };
5    |             ^^^^^^^^^^----^^
6    |             |         |
7    |             |         found here
8    |             expected (), found bool
9    |
10    = note: expected type `()`
11               found type `bool`
12    = note: `if` expressions without `else` evaluate to `()`
13    = help: consider adding an `else` block that evaluates to the expected type
14
15 error: aborting due to previous error
16
17 For more information about this error, try `rustc --explain E0317`.