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

E0450 needs to be updated to new format #35925

Closed
sophiajt opened this issue Aug 23, 2016 · 0 comments
Closed

E0450 needs to be updated to new format #35925

sophiajt opened this issue Aug 23, 2016 · 0 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.

Comments

@sophiajt
Copy link
Contributor

sophiajt commented Aug 23, 2016

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

E0450 needs a span_label, updating it from:

error[E0450]: cannot invoke tuple struct constructor with private fields
  --> src/test/compile-fail/E0450.rs:16:13
   |
16 |     let f = Bar::Foo(0); //~ ERROR E0450
   |             ^^^^^^^^

To:

error[E0450]: cannot invoke tuple struct constructor with private fields
  --> src/test/compile-fail/E0450.rs:16:13
   |
16 |     let f = Bar::Foo(0); //~ ERROR E0450
   |             ^^^^^^^^ cannot construct with a private field

Bonus: add a label to where the private field comes from:

error[E0450]: cannot invoke tuple struct constructor with private fields
  --> src/test/compile-fail/E0450.rs:16:13
   |
12 |     pub struct Foo(isize);
   |                    ----- private field declared here
...
16 |     let f = Bar::Foo(0); //~ ERROR E0450
   |             ^^^^^^^^ cannot construct with a private field

Alternatively, if underlining the private field is too tricky, just underline the whole tuple constructor definition.

@bstrie bstrie added the A-diagnostics Area: Messages for errors, warnings, and lints label Aug 24, 2016
@brson brson added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Aug 26, 2016
sophiajt pushed a commit to sophiajt/rust that referenced this issue Aug 27, 2016
update error E0450 to new format

Fixes rust-lang#35925 as part of rust-lang#35233.

I've solve the bonus, and I wonder if any simpler way to do this. But may be possible simplify if let expressions?

r? @jonathandturner
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.
Projects
None yet
Development

No branches or pull requests

3 participants