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

Merged
merged 1 commit into from Oct 31, 2016

Conversation

Projects
None yet
4 participants
@AndiDog
Contributor

AndiDog commented Oct 29, 2016

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 did make check-stage1-cfail NO_REBUILD=1 but that doesn't test the inlined example.

r? @GuillaumeGomez

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Oct 29, 2016

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"),

This comment has been minimized.

@GuillaumeGomez

GuillaumeGomez Oct 30, 2016

Member

Please remove this empty line.

```compile_fail,E0532
enum State {
Succeeded,
Failed(String), // error message

This comment has been minimized.

@GuillaumeGomez

GuillaumeGomez Oct 30, 2016

Member

I'm not sure this comment helps. It could actually mislead readers.

```
enum State {
Succeeded,
Failed(String), // error message

This comment has been minimized.

@GuillaumeGomez
fn print_on_failure(state: &State) {
match *state {
State::Failed(ref msg) => println!("Failed with {}", msg),

This comment has been minimized.

@GuillaumeGomez
@GuillaumeGomez

This comment has been minimized.

Member

GuillaumeGomez commented Oct 30, 2016

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).

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.

In order to test error code examples, you have to run:

make doc/error-index.md
rustdoc --test doc/error-index.md

Otherwise don't worry, they are tested by travis and the bot before merge. :)

@AndiDog AndiDog force-pushed the AndiDog:feature/error-explanation-E0532 branch from 06e3ffc to c8937e0 Oct 31, 2016

@AndiDog

This comment has been minimized.

Contributor

AndiDog commented Oct 31, 2016

Changes made as requested

@GuillaumeGomez

This comment has been minimized.

Member

GuillaumeGomez commented Oct 31, 2016

Thanks!

@bors: r+ rollup

@bors

This comment has been minimized.

Contributor

bors commented Oct 31, 2016

📌 Commit c8937e0 has been approved by GuillaumeGomez

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Oct 31, 2016

Rollup merge of rust-lang#37475 - AndiDog:feature/error-explanation-E…
…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

bors added a commit that referenced this pull request Oct 31, 2016

Auto merge of #37494 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 5 pull requests

- Successful merges: #37438, #37458, #37462, #37475, #37486
- Failed merges:

@bors bors merged commit c8937e0 into rust-lang:master Oct 31, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@AndiDog AndiDog deleted the AndiDog:feature/error-explanation-E0532 branch Oct 31, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment