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

Confusing error message with < binop #11962

Closed
ghost opened this issue Jan 31, 2014 · 3 comments
Closed

Confusing error message with < binop #11962

ghost opened this issue Jan 31, 2014 · 3 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@ghost
Copy link

ghost commented Jan 31, 2014

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.

@steveklabnik
Copy link
Member

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 {
                               ^

@steveklabnik steveklabnik added the A-diagnostics Area: Messages for errors, warnings, and lints label Jan 23, 2015
@steveklabnik
Copy link
Member

Triage: no change.

@steveklabnik steveklabnik added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Mar 9, 2017
@Mark-Simulacrum
Copy link
Member

Closing in favor of #22644.

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 T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants