rust/src/test/ui/block-result/issue-20862.stderr

30 lines
811 B
Plaintext
Raw Normal View History

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) {
| - possibly return type missing here?
2018-02-22 18:42:32 -06:00
LL | |y| x + y
| ^^^^^^^^^ 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
|
LL | / fn foo(x: i32) {
LL | | |y| x + y
2019-03-09 06:03:44 -06:00
LL | |
LL | | }
| |_- `foo` defined here returns `()`
...
LL | let x = foo(5)(2);
| ^^^^^^---
| |
| call expression requires function
2017-06-23 19:43:35 -05:00
error: aborting due to 2 previous errors
2017-06-23 19:43:35 -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`.