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

Tweak non-char/numeric in range pattern diagnostic #66283

Closed
estebank opened this issue Nov 11, 2019 · 0 comments · Fixed by #66351
Closed

Tweak non-char/numeric in range pattern diagnostic #66283

estebank opened this issue Nov 11, 2019 · 0 comments · Fixed by #66351
Labels
A-diagnostics Area: Messages for errors, warnings, and lints P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@estebank
Copy link
Contributor

We currently emit:

error[E0029]: only char and numeric types are allowed in range patterns
 --> src/main.rs:4:12
  |
4 |         0.."" => {}
  |            ^^ ranges require char or numeric types
  |
  = note: start type: {integer}
  = note: end type: &'static str

But it should be closer to:

error[E0029]: only char and numeric types are allowed in range patterns
 --> src/main.rs:4:12
  |
4 |         0.."" => {}
  |         -  ^^ this is of type `&'static str` but it should be `char` or numeric
  |         |
  |         this is of type `{integer}`
@estebank estebank added A-diagnostics Area: Messages for errors, warnings, and lints P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 11, 2019
@bors bors closed this as completed in 20c3562 Nov 14, 2019
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 P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant