address review comments

This commit is contained in:
Esteban Küber 2019-03-07 14:08:20 -08:00
parent 369058eacd
commit ffa40cb45c
5 changed files with 44 additions and 34 deletions

View file

@ -2,15 +2,16 @@ error[E0317]: if may be missing an else clause
--> $DIR/if-without-else-as-fn-expr.rs:2:5
|
LL | fn foo(bar: usize) -> usize {
| ----- found `usize` because of this return type
| ----- expected `usize` because of this return type
LL | / if bar % 5 == 0 {
LL | | return 3;
LL | | }
| |_____^ expected (), found usize
| |_____^ expected usize, found ()
|
= note: expected type `()`
found type `usize`
= note: `if` expressions without `else` must evaluate to `()`
= note: expected type `usize`
found type `()`
= 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

View file

@ -6,7 +6,8 @@ LL | let a = if true { true };
|
= note: expected type `()`
found type `bool`
= note: `if` expressions without `else` must evaluate to `()`
= 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

View file

@ -13,7 +13,8 @@ LL | | };
|
= note: expected type `()`
found type `{integer}`
= note: `if` expressions without `else` must evaluate to `()`
= 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

View file

@ -6,7 +6,8 @@ LL | Drop = assert_eq!(1, 1)
|
= note: expected type `()`
found type `isize`
= note: `if` expressions without `else` must evaluate to `()`
= note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: aborting due to previous error