Given the following code: link
fn main() {
for i i in 0..10 {
}
}
The current output is:
Compiling playground v0.0.1 (/playground)
error: missing `in` in `for` loop
--> src/main.rs:2:10
|
2 | for i i in 0..10 {
| ^ help: try adding `in` here
error: expected `{`, found keyword `in`
--> src/main.rs:2:13
|
2 | for i i in 0..10 {
| ^^ expected `{`
error: could not compile `playground` due to 2 previous errors
Ideally the compiler should check the validity of next few tokens in the source code before emitting an error of ( missing in in for loop ). If wanted we can even suggest adding a _ to delimit the identifier, though if might not be worth the effort. Thanks.
@rustbot label +D-invalid-suggestion +D-confusing
Given the following code: link
The current output is:
Ideally the compiler should check the validity of next few tokens in the source code before emitting an error of ( missing
ininforloop ). If wanted we can even suggest adding a_to delimit the identifier, though if might not be worth the effort. Thanks.@rustbot label +D-invalid-suggestion +D-confusing