fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
811 B29 linesraw
1error[E0308]: mismatched types
2  --> $DIR/issue-20862.rs:2:5
3   |
4LL | fn foo(x: i32) {
5   |                - possibly return type missing here?
6LL |     |y| x + y
7   |     ^^^^^^^^^ expected `()`, found closure
8   |
9   = note: expected unit type `()`
10                found closure `[closure@$DIR/issue-20862.rs:2:5: 2:14 x:_]`
11
12error[E0618]: expected function, found `()`
13  --> $DIR/issue-20862.rs:7:13
14   |
15LL | / fn foo(x: i32) {
16LL | |     |y| x + y
17LL | |
18LL | | }
19   | |_- `foo` defined here returns `()`
20...
21LL |       let x = foo(5)(2);
22   |               ^^^^^^---
23   |               |
24   |               call expression requires function
25
26error: aborting due to 2 previous errors
27
28Some errors have detailed explanations: E0308, E0618.
29For more information about an error, try `rustc --explain E0308`.