Skip to content

Can't find E0704 error code info #55398

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
Undin opened this issue Oct 26, 2018 · 3 comments · Fixed by #59634
Closed

Can't find E0704 error code info #55398

Undin opened this issue Oct 26, 2018 · 3 comments · Fixed by #59634
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools P-medium Medium priority

Comments

@Undin
Copy link
Contributor

Undin commented Oct 26, 2018

Environment: rustc 1.31.0-nightly (4bd4e41 2018-10-25) and rustc 1.30.0 (da5f414 2018-10-24)

Rustc produces E0704 error code on the following (syntactically wrong) code:

mod foo {
    pub(foo) struct Bar {
        x: i32
    }
}
error[E0704]: incorrect visibility restriction
  --> src/main.rs:35:9
   |
35 |     pub(foo) struct Bar {
   |         ^^^ help: make this visible only to module `foo` with `in`: `in foo`
   |
   = help: some possible visibility restrictions are:
           `pub(crate)`: visible only on the current crate
           `pub(super)`: visible only in the current module's parent
           `pub(in path::to::module)`: visible only on the specified path

error: aborting due to previous error

For more information about this error, try `rustc --explain E0704`.

But but neither rustc --explain E0704 nor https://doc.rust-lang.org/error-index.html is aware of this error

@estebank estebank added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Oct 26, 2018
@steveklabnik steveklabnik added the P-medium Medium priority label Dec 27, 2018
@DevQps
Copy link
Contributor

DevQps commented Mar 30, 2019

@Undin I can pick this up unless you'd want to do it yourself!

@steveklabnik This will be the first the I am writing docs for errors (unless Undin wants to do it of course). I guess the general structure looks a bit like this?:

  • Short description of the error
  • Example of bad syntax
  • Example of good syntax

Or should there be something else I can add?

@Undin
Copy link
Contributor Author

Undin commented Mar 30, 2019

@DevQps Unfortunately, at this moment I don't have enough time to fix it myself so I will be glad if you fix it

@DevQps
Copy link
Contributor

DevQps commented Apr 1, 2019

@Undin I will try my best this week! Hopefully I'll be able to create a PR on Wednesday. I'll tag you once it's done :)

Centril added a commit to Centril/rust that referenced this issue 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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools P-medium Medium priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants