2017-06-23 19:43:35 -05:00
|
|
|
error[E0308]: mismatched types
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/issue-20862.rs:2:5
|
2017-06-23 19:43:35 -05:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | fn foo(x: i32) {
|
2017-06-24 21:28:43 -05:00
|
|
|
| - possibly return type missing here?
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | |y| x + y
|
2019-11-15 11:37:01 -06:00
|
|
|
| ^^^^^^^^^ expected `()`, found closure
|
2017-06-23 19:43:35 -05:00
|
|
|
|
|
2019-11-14 16:08:08 -06:00
|
|
|
= note: expected unit type `()`
|
|
|
|
found closure `[closure@$DIR/issue-20862.rs:2:5: 2:14 x:_]`
|
2017-06-23 19:43:35 -05:00
|
|
|
|
|
|
|
error[E0618]: expected function, found `()`
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/issue-20862.rs:7:13
|
2017-06-23 19:43:35 -05:00
|
|
|
|
|
2018-11-10 22:46:05 -06:00
|
|
|
LL | / fn foo(x: i32) {
|
|
|
|
LL | | |y| x + y
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | |
|
2018-11-10 22:46:05 -06:00
|
|
|
LL | | }
|
|
|
|
| |_- `foo` defined here returns `()`
|
|
|
|
...
|
|
|
|
LL | let x = foo(5)(2);
|
|
|
|
| ^^^^^^---
|
|
|
|
| |
|
|
|
|
| call expression requires function
|
2017-06-23 19:43:35 -05:00
|
|
|
|
2017-07-02 08:09:09 -05:00
|
|
|
error: aborting due to 2 previous errors
|
2017-06-23 19:43:35 -05:00
|
|
|
|
2019-04-17 12:26:38 -05:00
|
|
|
Some errors have detailed explanations: E0308, E0618.
|
2018-03-03 08:59:40 -06:00
|
|
|
For more information about an error, try `rustc --explain E0308`.
|