Skip to content

E0326 needs to be updated to new format #35335

Closed

Description

@sophiajt

From: src/test/compile-fail/associated-const-impl-wrong-type.rs

Just a "bonus" or two for this one. E0326 already uses the new format, but it isn't getting as much benefit as it could. Here, also show the conflicting part of the trait, so updating it from:

error[E0326]: implemented const `BAR` has an incompatible type for trait
  --> src/test/compile-fail/associated-const-impl-wrong-type.rs:20:5
   |
20 |     const BAR: i32 = -1;
   |     ^^^^^^^^^^^^^^^^^^^^ expected u32, found i32

To:

error[E0326]: implemented const `BAR` has an incompatible type for trait
  --> src/test/compile-fail/associated-const-impl-wrong-type.rs:20:5
   |
14 |     const BAR: u32;
   |     --------------- original trait requirement
...
20 |     const BAR: i32 = -1;
   |     ^^^^^^^^^^^^^^^^^^^^ expected u32, found i32

If we really wanted to get fancy, we could narrow the spans on the type itself:

error[E0326]: implemented const `BAR` has an incompatible type for trait
  --> src/test/compile-fail/associated-const-impl-wrong-type.rs:20:5
   |
14 |     const BAR: u32;
   |                --- original trait requirement
...
20 |     const BAR: i32 = -1;
   |                ^^^ expected u32

Activity

  1. added
    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
    A-diagnosticsArea: Messages for errors, warnings, and lints
    E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
    on Aug 4, 2016
  2. trixnz commented on Aug 5, 2016

    @trixnz
    Contributor

    Taking care of this one.

  3. added a commit that references this issue on Aug 5, 2016
    36af476
  4. added 2 commits that reference this issue on Aug 10, 2016
    3da08f3
    e24c326
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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