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

Added an explanation for the E0704 error. #59634

Merged
merged 1 commit into from
May 2, 2019

Conversation

DevQps
Copy link
Contributor

@DevQps DevQps commented Apr 2, 2019

Description

Adds an explanation on the E0704 error. I tried to stick as closely to the message that the compiler generates. It's the first time I am fixing error messages here, so if there is something I did wrong or should improve, please let me know.

closes #55398

@rust-highfive
Copy link
Collaborator

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 2, 2019
@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

@DevQps
Copy link
Contributor Author

DevQps commented Apr 2, 2019

@eddyb I am trying to understand the error that Travis gives me, but I am failing to understand what went wrong. When I search the project for "E0704", the only things come up are:

  • src\test\ui\pub\pub-restricted.stderr (of which I do not truly understand it's purpose, it seems like a template for error messages?)
  • src\libsyntax\diagnostic_list.rs (to which I added the error explanation)
  • src\libsyntax\parse\parser.rs (which seems to reference the error)

Hope you can give me a pointer :)

@DevQps
Copy link
Contributor Author

DevQps commented Apr 9, 2019

@eddyb Could you maybe respond to my previous questions?

@bors

This comment has been minimized.

@estebank
Copy link
Contributor

estebank commented Apr 18, 2019

@DevQps tidy is complaining that the same error code appears twice, once in the placeholder list and once with a description. As you have a description, just remove line 443 and it will satisfy tidy. That list is only for error codes that do not have a description, but that we want to statically check for creation somewhere.

You will also need to rebase due to a recently merged PR introducing conflicts.

@DevQps DevQps force-pushed the explain-E0704 branch 3 times, most recently from d0ba421 to 0156b56 Compare April 20, 2019 16:09
@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

@estebank
Copy link
Contributor

Need to run ./x.py test src/test/ui --stage 1 --bless

@rust-highfive

This comment has been minimized.

@estebank
Copy link
Contributor

r? @estebank

@rust-highfive rust-highfive assigned estebank and unassigned eddyb Apr 24, 2019
@estebank
Copy link
Contributor

@DevQps great work! It seems like the code should work well now. Would you mind squashing your commits? I feel this can be merged then, gated on Travis being happy.

@rust-highfive

This comment has been minimized.

@DevQps
Copy link
Contributor Author

DevQps commented Apr 24, 2019

@estebank I squashed them! I just saw that my IDE includes the description of each commit though. Hope that's not too much of a problem! Otherwise I will go try and fix it somehow :)

EDIT: I don't understand what went wrong. I checked it on the playground and there it works: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=a15911ab678f31233b9d06fa62e47095

@rust-highfive

This comment has been minimized.

@estebank
Copy link
Contributor

I'm not sure why it fails. @QuietMisdreavus, would you know what in rustdoc's world could cause the error we're seeing here?

@QuietMisdreavus
Copy link
Member

Rustdoc is probably wrapping that code in a main function, which hides the module. You probably need to add an empty fn main to the sample to prevent that. (Doing that on the playground seems to give the same error, at least.)

@rust-highfive

This comment has been minimized.

@DevQps
Copy link
Contributor Author

DevQps commented May 1, 2019

@estebank I squashed them! Bors succeeded last time, so I guess it will be good this way as well. Thanks a lot for all your help. I sometimes miss the small parts here and there :) Glad you're here help me catch them.

@estebank
Copy link
Contributor

estebank commented May 1, 2019

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 1, 2019

📌 Commit 2be37ad has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 1, 2019
Centril added a commit to Centril/rust that referenced this pull request May 1, 2019
Added an explanation for the E0704 error.

# Description
Adds an explanation on the E0704 error. I tried to stick as closely to the message that the compiler generates. It's the first time I am fixing error messages here, so if there is something I did wrong or should improve, please let me know.

closes rust-lang#55398
bors added a commit that referenced this pull request May 2, 2019
Rollup of 7 pull requests

Successful merges:

 - #59634 (Added an explanation for the E0704 error.)
 - #60348 (move some functions from parser.rs to diagostics.rs)
 - #60385 (Emit metadata files earlier)
 - #60428 (Refactor `eval_body_using_ecx` so that it doesn't need to query for MIR)
 - #60437 (Ensure that drop order of `async fn` matches `fn` and that users cannot refer to generated arguments.)
 - #60439 (doc: Warn about possible zombie apocalypse)
 - #60452 (Remove Context and ContextKind)

Failed merges:

r? @ghost
@bors bors merged commit 2be37ad into rust-lang:master May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't find E0704 error code info
6 participants