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