Skip to content

E0029 needs to be updated to new format #35201

Closed
@sophiajt

Description

From: src/test/compile-fail/E0029.rs

The E0029 error needs a span_label, taking it from:

error[E0029]: only char and numeric types are allowed in range patterns
 start type: &'static str
 end type: &'static str
  --> src/test/compile-fail/E0029.rs:15:9
   |
15 |         "hello" ... "world" => {} //~ ERROR E0029
   |         ^^^^^^^^^^^^^^^^^^^

to:

error[E0029]: only char and numeric types are allowed in range patterns
 start type: &'static str
 end type: &'static str
  --> src/test/compile-fail/E0029.rs:15:9
   |
15 |         "hello" ... "world" => {} //~ ERROR E0029
   |         ^^^^^^^^^^^^^^^^^^^ ranges require char or numeric types

Bonus: The start type and end type should probably be added as notes to the error rather than part of the main message text, something like:

error[E0029]: only char and numeric types are allowed in range patterns
  --> src/test/compile-fail/E0029.rs:15:9
   |
15 |         "hello" ... "world" => {} //~ ERROR E0029
   |         ^^^^^^^^^^^^^^^^^^^ ranges require char or numeric types
   |
   = note: starting type is &'static str
   = note: ending type is &'static str

Activity

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

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions