Skip to content

E0071 needs to be updated to new format #35220

Closed
@sophiajt

Description

@sophiajt

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

Error E0071 needs a span_label, updating it from:

error[E0071]: `Foo::FirstValue` does not name a struct or a struct variant
  --> src/test/compile-fail/E0071.rs:14:13
   |
14 |     let u = Foo::FirstValue { value: 0 }; //~ ERROR E0071
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0071]: `u32` does not name a struct or a struct variant
  --> src/test/compile-fail/E0071.rs:15:13
   |
15 |     let t = u32 { value: 4 }; //~ ERROR E0071
   |             ^^^^^^^^^^^^^^^^

To:

error[E0071]: `Foo::FirstValue` does not name a struct or a struct variant
  --> src/test/compile-fail/E0071.rs:14:13
   |
14 |     let u = Foo::FirstValue { value: 0 }; //~ ERROR E0071
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a struct

error[E0071]: `u32` does not name a struct or a struct variant
  --> src/test/compile-fail/E0071.rs:15:13
   |
15 |     let t = u32 { value: 4 }; //~ ERROR E0071
   |             ^^^^^^^^^^^^^^^^ not a struct

Bonus: The span should underline only the name of the thing that's not a struct rather than the whole expression. Example:

error[E0071]: `u32` does not name a struct or a struct variant
  --> src/test/compile-fail/E0071.rs:15:13
   |
15 |     let t = u32 { value: 4 }; //~ ERROR E0071
   |             ^^^ not a struct

This may require additional compiler changes.

Metadata

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