-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Confusing error when using do instead of for #2817
Comments
If we'd remove the |
@Lenny222 We could possibly have one keyword that just does the right thing based on the closure type. |
Having only a |
Seems like the typechecker should attempt to see if "for" would have been the right thing, and said "Did you mean 'for'?". (Same for the other way around.) |
@Lenny222 I feel like that would be too magical. Silently inserting the equivalent of |
If a do-block body has the wrong type, or a for-loop body has a non-() type, suggest that the user might have meant the other one. As per rust-lang#2817
rustup Doing a sync just before I do a rustc-push
Update rust toolchain to 2023-10-16 and update failing test. The coverage test was failing because the logic was being pruned by rustup. Resolves rust-lang#2817
Range should have been called with
for
The text was updated successfully, but these errors were encountered: