Closed
Description
This code isn't valid Rust:
let x = (let y = 6);
We have an okay, but not great, diagnostic here:
src/main.rs:2:14: 2:17 error: expected identifier, found keyword `let`
src/main.rs:2 let x = (let y = 6);
^~~
src/main.rs:2:18: 2:19 error: expected one of `!`, `)`, `,`, `.`, `::`, `{`, or an operator, found `y`
src/main.rs:2 let x = (let y = 6);
^
It might be nice to add a note
when the keyword found is let
that mentions that let
is not an expression, and so cannot be used in this way.