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

E0025 needs to be updated to new format #35198

Closed
sophiajt opened this issue Aug 2, 2016 · 5 comments
Closed

E0025 needs to be updated to new format #35198

sophiajt opened this issue Aug 2, 2016 · 5 comments
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 2, 2016

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

E0025 needs span_label instead of span_note, changing it from:

error[E0025]: field `a` bound multiple times in the pattern
  --> src/test/compile-fail/E0025.rs:18:21
   |
18 |     let Foo { a: x, a: y, b: 0 } = x; //~ ERROR E0025
   |                     ^^^^
   |
note: field `a` previously bound here
  --> src/test/compile-fail/E0025.rs:18:15
   |
18 |     let Foo { a: x, a: y, b: 0 } = x; //~ ERROR E0025
   |               ^^^^

To:

error[E0025]: field `a` bound multiple times in the pattern
  --> src/test/compile-fail/E0025.rs:18:21
   |
18 |     let Foo { a: x, a: y, b: 0 } = x; //~ ERROR E0025
   |               ----  ^^^^ multiple uses of `a` in pattern
   |               |
   |               first use of `a`
@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 2, 2016
@alexispurslane
Copy link
Contributor

I'd like to handle this.

@sophiajt
Copy link
Contributor Author

@ChristopherDumas - thanks for volunteering! Currently @pcn signed up for this on the big error list, though I'm thinking it's time for us to have more people working on the errors since some people get busy.

@alexispurslane
Copy link
Contributor

I'll work on this, but if @pcn gets to it first, I'll not make a pull request.

@pcn
Copy link
Contributor

pcn commented Sep 24, 2016

This one is more complex than the others I've looked at. The current code in _match.rs looks like this:

Occupied(occupied) => {
let mut err = struct_span_err!(tcx.sess, span, E0025,
"field `{}` bound multiple times \
in the pattern",
field.name);
span_note!(&mut err, *occupied.get(),
"field `{}` previously bound here",
field.name);
err.emit();
tcx.types.err
}

Naively changing the span_note to a span_label seems to cause an issue and I digressed to read more about lifetimes, the borrow checker, etc. but haven't been able to translate that into a good understanding and a fix. @ChristopherDumas if you've already had experience with this, I'd love to learn from you.

@bstrie
Copy link
Contributor

bstrie commented Sep 25, 2016

Freeing this one up as part of the final push for #35233.

sophiajt pushed a commit to sophiajt/rust that referenced this issue Sep 28, 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

4 participants