Skip to content

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

Closed
@vi

Description

@vi
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.

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lints

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions