blob: 763f19ccc6454b09083417379b7b3a5eae5df171 (
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
error: expected `{`, found `22`
--> $DIR/closure-return-syntax.rs:5:23
|
LL | let x = || -> i32 22;
| --- ^^
| |
| explicit return type requires closure body to be enclosed in braces
|
help: wrap the expression in curly braces
|
LL | let x = || -> i32 { 22 };
| + +
error: expected `{`, found `(`
--> $DIR/closure-return-syntax.rs:12:34
|
LL | let x = || -> (i32, i32) (1, 2);
| ---------- ^
| |
| explicit return type requires closure body to be enclosed in braces
|
help: wrap the expression in curly braces
|
LL | let x = || -> (i32, i32) { (1, 2) };
| + +
error: expected `{`, found `[`
--> $DIR/closure-return-syntax.rs:17:32
|
LL | let c = || -> [i32; 2] [1, 2];
| -------- ^
| |
| explicit return type requires closure body to be enclosed in braces
|
help: wrap the expression in curly braces
|
LL | let c = || -> [i32; 2] { [1, 2] };
| + +
error: aborting due to 3 previous errors
|