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

E0326 needs to be updated to new format #35335

Closed
sophiajt opened this issue Aug 4, 2016 · 1 comment
Closed

E0326 needs to be updated to new format #35335

sophiajt opened this issue Aug 4, 2016 · 1 comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Comments

@sophiajt
Copy link
Contributor

sophiajt commented Aug 4, 2016

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
@sophiajt sophiajt added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. A-diagnostics Area: Messages for errors, warnings, and lints E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Aug 4, 2016
@trixnz
Copy link
Contributor

trixnz commented Aug 5, 2016

Taking care of this one.

sophiajt pushed a commit to sophiajt/rust that referenced this issue Aug 5, 2016
sophiajt pushed a commit to sophiajt/rust that referenced this issue Aug 10, 2016
sophiajt pushed a commit to sophiajt/rust that referenced this issue Aug 11, 2016
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 E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Projects
None yet
Development

No branches or pull requests

2 participants