2020-03-05 05:49:30 +01:00
|
|
|
error: expected `{`, found `22`
|
2019-01-06 18:33:05 +03:00
|
|
|
--> $DIR/closure-return-syntax.rs:5:23
|
2018-10-20 23:36:17 +03:00
|
|
|
|
|
|
|
|
|
LL | let x = || -> i32 22;
|
2025-03-20 15:44:44 +00:00
|
|
|
| --- ^^
|
|
|
|
|
| |
|
|
|
|
|
| explicit return type requires closure body to be enclosed in braces
|
2022-01-12 20:43:24 +00:00
|
|
|
|
|
2025-03-20 15:44:44 +00:00
|
|
|
help: wrap the expression in curly braces
|
2022-01-12 20:43:24 +00:00
|
|
|
|
|
|
|
|
|
LL | let x = || -> i32 { 22 };
|
|
|
|
|
| + +
|
2018-10-20 23:36:17 +03:00
|
|
|
|
2025-03-20 15:46:19 +00:00
|
|
|
error: expected `{`, found `(`
|
|
|
|
|
--> $DIR/closure-return-syntax.rs:12:34
|
|
|
|
|
|
|
|
|
|
|
LL | let x = || -> (i32, i32) (1, 2);
|
2025-03-20 15:44:44 +00:00
|
|
|
| ---------- ^
|
|
|
|
|
| |
|
|
|
|
|
| explicit return type requires closure body to be enclosed in braces
|
2025-03-20 15:46:19 +00:00
|
|
|
|
|
2025-03-20 15:44:44 +00:00
|
|
|
help: wrap the expression in curly braces
|
2025-03-20 15:46:19 +00:00
|
|
|
|
|
|
|
|
|
LL | let x = || -> (i32, i32) { (1, 2) };
|
|
|
|
|
| + +
|
|
|
|
|
|
|
|
|
|
error: expected `{`, found `[`
|
|
|
|
|
--> $DIR/closure-return-syntax.rs:17:32
|
|
|
|
|
|
|
|
|
|
|
LL | let c = || -> [i32; 2] [1, 2];
|
2025-03-20 15:44:44 +00:00
|
|
|
| -------- ^
|
|
|
|
|
| |
|
|
|
|
|
| explicit return type requires closure body to be enclosed in braces
|
2025-03-20 15:46:19 +00:00
|
|
|
|
|
2025-03-20 15:44:44 +00:00
|
|
|
help: wrap the expression in curly braces
|
2025-03-20 15:46:19 +00:00
|
|
|
|
|
|
|
|
|
LL | let c = || -> [i32; 2] { [1, 2] };
|
|
|
|
|
| + +
|
|
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
2018-10-20 23:36:17 +03:00
|
|
|
|