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

Updated E0560 to new error format #36330

Merged
merged 2 commits into from
Sep 22, 2016
Merged

Updated E0560 to new error format #36330

merged 2 commits into from
Sep 22, 2016

Conversation

aclarry
Copy link
Contributor

@aclarry aclarry commented Sep 7, 2016

Added a small bit of code to add a label for E0560.

Also renamed src/test/compile-fail/E560.rs file to E0560.rs (not sure why it was named E560).
Updated all test cases which check this error.

Closes #36199

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Aatch (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@Cobrand
Copy link
Contributor

Cobrand commented Sep 8, 2016

@aclarry As expected, your PR for E0560 and mine for E0559 are in conflict. You have to rebase your PR onto master so there are no conflicts anymore.

By the way, @jonathandturner takes care of the "update to new format" thing, so you have to tell rust-highfive that he is the assignee, by doing like so :
r? @jonathandturner
(Of course that won't do anything since only the creator of the PR can do that)

Otherwise your PR will probably go unnoticed for awhile :)

@aclarry
Copy link
Contributor Author

aclarry commented Sep 9, 2016

@Cobrand thanks for the heads up, I thought I merged in your changes, but apparently not :)

r? @jonathandturner

@rust-highfive rust-highfive assigned sophiajt and unassigned Aatch Sep 9, 2016
@bors
Copy link
Contributor

bors commented Sep 9, 2016

☔ The latest upstream changes (presumably #36331) made this pull request unmergeable. Please resolve the merge conflicts.

@sophiajt
Copy link
Contributor

sophiajt commented Sep 9, 2016

@aclarry - looks good. After you fix up the conflict, you can ping me and we can give it a go.

@aclarry
Copy link
Contributor Author

aclarry commented Sep 9, 2016

@jonathandturner I'm running into a bit of a conflict with E0559. Specifically, which behaviour do we want when we can also suggest a field name?

  1. Don't include E0560 label
error[E0559]: variant `Field::Fool` has no field named `joke`
 --> src/test/compile-fail/E0559.rs:16:27
   | 
16 |     let s = Field::Fool { joke: 0 }; 
   |                           ^^^^ did you mean `x`?    
  1. Include label combining E0559 and E0560
error[E0559]: variant `Field::Fool` has no field named `joke`
 --> src/test/compile-fail/E0559.rs:16:27
   | 
16 |     let s = Field::Fool { joke: 0 }; 
   |                           ^^^^ `Field::Fool` does not have this field. Did you mean `x`?    
  1. Include both labels
error[E0559]: variant `Field::Fool` has no field named `joke`
 --> src/test/compile-fail/E0559.rs:16:27
   | 
16 |     let s = Field::Fool { joke: 0 }; 
   |                           ^^^^   
   |                           | `Field::Fool` does not have this field.
   |                           |  did you mean `x`?  

I'm going to update my PR to use 2), since it seems the most natural, but let me know what the preferred format is.

@sophiajt
Copy link
Contributor

I lean towards option 1. We could make it explain a little more as well:

error[E0559]: variant `Field::Fool` has no field named `joke`
 --> src/test/compile-fail/E0559.rs:16:27
   | 
16 |     let s = Field::Fool { joke: 0 }; 
   |                           ^^^^ unknown field - did you mean `x`?  

@aclarry aclarry force-pushed the e0560-update branch 4 times, most recently from 35cfda8 to f957f0d Compare September 16, 2016 12:56
@sophiajt
Copy link
Contributor

@aclarry - Looks like it's not currently building:

error[E0531]: unresolved variant or struct `TyEnum`
    --> src/librustc_typeck/check/mod.rs:3097:23
     |
3097 |         } else if let ty::TyEnum(..) = ty.sty {
     |                       ^^^^^^^^^^

error: aborting due to previous error

@aclarry
Copy link
Contributor Author

aclarry commented Sep 16, 2016

@jonathandturner Yep, just working that out at the moment. I updated the PR to use the message field does not exist - did you mean x?

@aclarry
Copy link
Contributor Author

aclarry commented Sep 20, 2016

@jonathandturner The CI tests have passed, this should be ready to merge if you're happy with the implementation and the updated label for E0559.

@sophiajt
Copy link
Contributor

Looks good!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 20, 2016

📌 Commit 23efc54 has been approved by jonathandturner

sophiajt pushed a commit to sophiajt/rust that referenced this pull request Sep 21, 2016
…rner

Updated E0560 to new error format

Added a small bit of code to add a label for E0560.

Also renamed src/test/compile-fail/E560.rs file to E0560.rs (not sure why it was named E560).
Updated all test cases which check this error.

Closes rust-lang#36199
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Sep 21, 2016
…rner

Updated E0560 to new error format

Added a small bit of code to add a label for E0560.

Also renamed src/test/compile-fail/E560.rs file to E0560.rs (not sure why it was named E560).
Updated all test cases which check this error.

Closes rust-lang#36199
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Sep 22, 2016
…rner

Updated E0560 to new error format

Added a small bit of code to add a label for E0560.

Also renamed src/test/compile-fail/E560.rs file to E0560.rs (not sure why it was named E560).
Updated all test cases which check this error.

Closes rust-lang#36199
bors added a commit that referenced this pull request Sep 22, 2016
Rollup of 7 pull requests

- Successful merges: #36330, #36423, #36539, #36571, #36589, #36600, #36632
- Failed merges:
@bors bors merged commit 23efc54 into rust-lang:master Sep 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants