Skip to content

Confusing error message with < binop #11962

Closed
@ghost

Description

lib.rs:11:21: 11:23 error: expected type, found token LIT_INT_UNSUFFIXED(16i64)
lib.rs:11     if foo as int < 16 {}

The solution is of course to parenthesize the cast so it doesn't get parsed as generics, but the error message does not help at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions