Skip to content

Confusing error message with < binop #11962

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.

Activity

  1. steveklabnik commented on Jan 23, 2015

    @steveklabnik
    Contributor

    This error got a little better:

    hello.rs:3:21: 3:22 error: expected type, found `5`
    hello.rs:3     if i as usize < 5 {
                                   ^
    
  2. steveklabnik commented on Feb 2, 2016

    @steveklabnik
    Contributor

    Triage: no change.

  3. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Mar 9, 2017
  4. Mark-Simulacrum commented on May 3, 2017

    @Mark-Simulacrum
    Member

    Closing in favor of #22644.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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