2022-02-06 16:43:51 +08:00
|
|
|
$ cargo run
|
|
|
|
Compiling functions v0.1.0 (file:///projects/functions)
|
2023-01-16 17:34:52 +08:00
|
|
|
error: expected expression, found `let` statement
|
|
|
|
--> src/main.rs:2:14
|
|
|
|
|
|
|
|
|
2 | let x = (let y = 6);
|
|
|
|
| ^^^
|
|
|
|
|
2022-02-06 16:43:51 +08:00
|
|
|
error: expected expression, found statement (`let`)
|
|
|
|
--> src/main.rs:2:14
|
|
|
|
|
|
|
|
|
2 | let x = (let y = 6);
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: variable declaration using `let` is a statement
|
|
|
|
|
2022-07-04 10:48:13 +08:00
|
|
|
error[E0658]: `let` expressions in this position are unstable
|
2022-02-06 16:43:51 +08:00
|
|
|
--> src/main.rs:2:14
|
|
|
|
|
|
|
|
|
2 | let x = (let y = 6);
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
|
|
|
|
|
|
|
|
warning: unnecessary parentheses around assigned value
|
|
|
|
--> src/main.rs:2:13
|
|
|
|
|
|
|
|
|
2 | let x = (let y = 6);
|
|
|
|
| ^ ^
|
|
|
|
|
|
|
|
|
= note: `#[warn(unused_parens)]` on by default
|
|
|
|
help: remove these parentheses
|
|
|
|
|
|
|
|
|
2 - let x = (let y = 6);
|
|
|
|
2 + let x = let y = 6;
|
2023-01-16 17:34:52 +08:00
|
|
|
|
|
2022-02-06 16:43:51 +08:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0658`.
|
|
|
|
warning: `functions` (bin "functions") generated 1 warning
|
2023-01-16 17:34:52 +08:00
|
|
|
error: could not compile `functions` due to 3 previous errors; 1 warning emitted
|