-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Error message provides suggested fix that does not compile #51972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Duplicate of #51634; messaging improved in #51670. Nightly output:
(Although this doesn't emit the bogus suggestion, this could arguably still be improved; the actual fix is to specify the type on the range ( |
@zackmdavis Thanks. Do you know if there is a reason why, theoretically, rust could not support this syntax eventually? |
@dralley There's an unstable |
Uh oh!
There was an error while loading. Please reload this page.
When I attempt to compile the code:
I get back an error message with a 'help' suggestion:
This is a great error message however the suggested code unfortunately does not work. Adding
: i32
to the previous code sample as suggested will also fail with the error:What does work, is changing
0..10
to0i32..10
. The rustc-suggested syntax does seem reasonable to me (as a newbie) so it's a little surprising that it's invalid.rustc version:
The text was updated successfully, but these errors were encountered: