Closed
Description
Given the following code:
fn main() {
const let foo = 123;
}
The current output is:
Compiling playground v0.0.1 (/playground)
error: expected identifier, found keyword `let`
--> src/main.rs:2:11
|
2 | const let foo = 123;
| ^^^ expected identifier, found keyword
error: expected one of `:`, `;`, or `=`, found `foo`
--> src/main.rs:2:15
|
2 | const let foo = 123;
| ^^^ expected one of `:`, `;`, or `=`
error: missing type for `const` item
--> src/main.rs:2:11
|
2 | const let foo = 123;
| ^^^ help: provide a type for the item: `r#let: <type>`
error: could not compile `playground` due to 3 previous errors
Ideally the output should inform the user that let
and const
are mutually exclusive and suggest the user remove the let
.