]>
Commit | Line | Data |
---|---|---|
041b39d2 | 1 | error[E0308]: mismatched types |
0731742a | 2 | --> $DIR/issue-20862.rs:2:5 |
041b39d2 | 3 | | |
0531ce1d | 4 | LL | fn foo(x: i32) { |
041b39d2 | 5 | | - possibly return type missing here? |
0531ce1d | 6 | LL | |y| x + y |
60c5eb7d | 7 | | ^^^^^^^^^ expected `()`, found closure |
041b39d2 | 8 | | |
60c5eb7d XL |
9 | = note: expected unit type `()` |
10 | found closure `[closure@$DIR/issue-20862.rs:2:5: 2:14 x:_]` | |
041b39d2 XL |
11 | |
12 | error[E0618]: expected function, found `()` | |
0731742a | 13 | --> $DIR/issue-20862.rs:7:13 |
041b39d2 | 14 | | |
a1dfa0c6 XL |
15 | LL | / fn foo(x: i32) { |
16 | LL | | |y| x + y | |
532ac7d7 | 17 | LL | | |
a1dfa0c6 XL |
18 | LL | | } |
19 | | |_- `foo` defined here returns `()` | |
20 | ... | |
21 | LL | let x = foo(5)(2); | |
22 | | ^^^^^^--- | |
23 | | | | |
24 | | call expression requires function | |
041b39d2 XL |
25 | |
26 | error: aborting due to 2 previous errors | |
27 | ||
48663c56 | 28 | Some errors have detailed explanations: E0308, E0618. |
0531ce1d | 29 | For more information about an error, try `rustc --explain E0308`. |