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) {
|
2021-12-15 17:49:03 -06:00
|
|
|
| - help: a return type might be 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 `()`
|
2022-06-27 00:45:35 -05:00
|
|
|
found closure `[closure@$DIR/issue-20862.rs:2:5: 2:8]`
|
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
|
|
|
|
|
2020-08-12 16:02:14 -05:00
|
|
|
LL | fn foo(x: i32) {
|
|
|
|
| -------------- `foo` defined here returns `()`
|
2018-11-10 22:46:05 -06:00
|
|
|
...
|
2020-08-12 16:02:14 -05:00
|
|
|
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`.
|