1 error[E0317]: if may be missing an else clause
2 --> $DIR/if-without-else-as-fn-expr.rs:2:5
4 LL | fn foo(bar: usize) -> usize {
5 | ----- expected `usize` because of this return type
6 LL | / if bar % 5 == 0 {
9 | |_____^ expected usize, found ()
11 = note: `if` expressions without `else` evaluate to `()`
12 = help: consider adding an `else` block that evaluates to the expected type
14 error[E0317]: if may be missing an else clause
15 --> $DIR/if-without-else-as-fn-expr.rs:9:20
17 LL | let x: usize = if bar % 5 == 0 {
18 | _________-__________^
20 | | expected because of this assignment
23 | |_____^ expected usize, found ()
25 = note: `if` expressions without `else` evaluate to `()`
26 = help: consider adding an `else` block that evaluates to the expected type
28 error[E0317]: if may be missing an else clause
29 --> $DIR/if-without-else-as-fn-expr.rs:17:5
31 LL | fn foo3(bar: usize) -> usize {
32 | ----- expected `usize` because of this return type
33 LL | / if bar % 5 == 0 {
36 | |_____^ expected usize, found ()
38 = note: `if` expressions without `else` evaluate to `()`
39 = help: consider adding an `else` block that evaluates to the expected type
41 error[E0317]: if may be missing an else clause
42 --> $DIR/if-without-else-as-fn-expr.rs:24:5
44 LL | fn foo_let(bar: usize) -> usize {
45 | ----- expected `usize` because of this return type
49 | |_____^ expected usize, found ()
51 = note: `if` expressions without `else` evaluate to `()`
52 = help: consider adding an `else` block that evaluates to the expected type
54 error[E0317]: if may be missing an else clause
55 --> $DIR/if-without-else-as-fn-expr.rs:31:20
57 LL | let x: usize = if let 0 = 1 {
58 | _________-__________^
60 | | expected because of this assignment
63 | |_____^ expected usize, found ()
65 = note: `if` expressions without `else` evaluate to `()`
66 = help: consider adding an `else` block that evaluates to the expected type
68 error[E0317]: if may be missing an else clause
69 --> $DIR/if-without-else-as-fn-expr.rs:39:5
71 LL | fn foo3_let(bar: usize) -> usize {
72 | ----- expected `usize` because of this return type
76 | |_____^ expected usize, found ()
78 = note: `if` expressions without `else` evaluate to `()`
79 = help: consider adding an `else` block that evaluates to the expected type
81 error: aborting due to 6 previous errors
83 For more information about this error, try `rustc --explain E0317`.