]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/if/if-without-else-result.stderr
Remove E0308 note when primary label has all info
[rust.git] / src / test / ui / if / if-without-else-result.stderr
index 2134781088c3dac3ac574313901f10dd205ad8f3..b2c700d3c8febd6e96a005e46d7b480006f94e5f 100644 (file)
@@ -2,10 +2,13 @@ error[E0317]: if may be missing an else clause
   --> $DIR/if-without-else-result.rs:2:13
    |
 LL |     let a = if true { true };
-   |             ^^^^^^^^^^^^^^^^ expected (), found bool
+   |             ^^^^^^^^^^----^^
+   |             |         |
+   |             |         found here
+   |             expected (), found bool
    |
-   = note: expected type `()`
-              found type `bool`
+   = note: `if` expressions without `else` evaluate to `()`
+   = help: consider adding an `else` block that evaluates to the expected type
 
 error: aborting due to previous error