summaryrefslogtreecommitdiffstats
path: root/src/test/ui/block-result/issue-20862.stderr
blob: 37bad64c5bf68582efccf225470cfdb6e660e38d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
error[E0308]: mismatched types
  --> $DIR/issue-20862.rs:2:5
   |
LL | fn foo(x: i32) {
   |                - help: a return type might be missing here: `-> _`
LL |     |y| x + y
   |     ^^^^^^^^^ expected `()`, found closure
   |
   = note: expected unit type `()`
                found closure `[closure@$DIR/issue-20862.rs:2:5: 2:8]`

error[E0618]: expected function, found `()`
  --> $DIR/issue-20862.rs:7:13
   |
LL | fn foo(x: i32) {
   | -------------- `foo` defined here returns `()`
...
LL |     let x = foo(5)(2);
   |             ^^^^^^---
   |             |
   |             call expression requires function

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0308, E0618.
For more information about an error, try `rustc --explain E0308`.