Skip to content

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

Closed
@estebank

Description

@estebank

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}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsP-lowLow priorityT-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