-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add E0532 error explanation #37475
Add E0532 error explanation #37475
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @GuillaumeGomez (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. |
// error: expected unit struct/variant or constant, found tuple | ||
// variant `State::Failed` | ||
State::Failed => println!("Failed"), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this empty line.
```compile_fail,E0532 | ||
enum State { | ||
Succeeded, | ||
Failed(String), // error message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this comment helps. It could actually mislead readers.
``` | ||
enum State { | ||
Succeeded, | ||
Failed(String), // error message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
fn print_on_failure(state: &State) { | ||
match *state { | ||
State::Failed(ref msg) => println!("Failed with {}", msg), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
Thanks for your PR! Just some minor typos and it's all good! Once done, don't forget to squash please (you can take a look here if you don't know how to do do it).
In order to test error code examples, you have to run:
Otherwise don't worry, they are tested by travis and the bot before merge. :) |
06e3ffc
to
c8937e0
Compare
Changes made as requested |
Thanks! @bors: r+ rollup |
📌 Commit c8937e0 has been approved by |
…0532, r=GuillaumeGomez Add E0532 error explanation This resolves one of the error list in rust-lang#35347 - just because I stumbled over it today. I assumed the error code should be removed from `register_diagnostics!` because it's now defined above. Since that is my first code contribution, please check that all is in order. It would be helpful to know how to run the test for the `compile_fail,E0532` part. I did `make check-stage1-cfail NO_REBUILD=1` but that doesn't test the inlined example. r? @GuillaumeGomez
This resolves one of the error list in #35347 - just because I stumbled over it today.
I assumed the error code should be removed from
register_diagnostics!
because it's now defined above.Since that is my first code contribution, please check that all is in order. It would be helpful to know how to run the test for the
compile_fail,E0532
part. I didmake check-stage1-cfail NO_REBUILD=1
but that doesn't test the inlined example.r? @GuillaumeGomez