Skip to content
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

Diagnostics: There may be special error message for trying to use "and" or "or" inside if #54109

Closed
vi opened this issue Sep 10, 2018 · 0 comments
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@vi
Copy link
Contributor

vi commented Sep 10, 2018

error: expected `{`, found `and`
   --> src/numplay.rs:102:24
    |
102 |             if ov == 3 and nv == 4 {
    |             --         ^^^ help: try placing this code inside a block: `{ and; }`
    |             |
    |             this `if` statement has a condition, but no block

error: aborting due to previous error

Error message is not very helpful. It should suggest && instead.

@csmoe csmoe added the A-diagnostics Area: Messages for errors, warnings, and lints label Sep 10, 2018
@csmoe csmoe self-assigned this Sep 11, 2018
vi added a commit to vi/rust that referenced this issue Sep 13, 2018
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Sep 16, 2018
Suggest && and || instead of 'and' and 'or'

Resolves rust-lang#54109.

Note: competing pull reqeust: rust-lang#54179

r? @csmoe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

2 participants