|
LL | {2} + {2}
| ^ expected `()`, found integer
+ |
+help: you might have meant to return this value
+ |
+LL | {return 2;} + {2}
+ | ^^^^^^ ^
error[E0308]: mismatched types
--> $DIR/expr-as-stmt.rs:12:6
|
LL | {2} + 2
| ^ expected `()`, found integer
+ |
+help: you might have meant to return this value
+ |
+LL | {return 2;} + 2
+ | ^^^^^^ ^
error[E0308]: mismatched types
--> $DIR/expr-as-stmt.rs:18:7
|
LL | { 42 } + foo;
| ^^ expected `()`, found integer
+ |
+help: you might have meant to return this value
+ |
+LL | { return 42; } + foo;
+ | ^^^^^^ ^
error[E0308]: mismatched types
--> $DIR/expr-as-stmt.rs:24:7
|
LL | { 3 } * 3
| ^ expected `()`, found integer
+ |
+help: you might have meant to return this value
+ |
+LL | { return 3; } * 3
+ | ^^^^^^ ^
error[E0614]: type `{integer}` cannot be dereferenced
--> $DIR/expr-as-stmt.rs:24:11