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