Skip to content

Incorrect error count when using the unsupported unary plus #36499

Closed
@0xmohit

Description

@0xmohit

Executing the following:

fn main() {
  2 + +2;
}

results in:

foo.rs:2:7: 2:8 error: expected expression, found `+`
foo.rs:2   2 + +2;
               ^
error: aborting due to 2 previous errors

The reference makes it clear that the above code would be rejected. However, the error count indicated doesn't appear to be correct.

Metadata

Metadata

Assignees

No one assigned

    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