]> git.proxmox.com Git - rustc.git/blame - src/librustc_error_codes/error_codes/E0704.md
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0704.md
CommitLineData
3dfed10e 1An incorrect visibility restriction was specified.
60c5eb7d 2
3dfed10e 3Erroneous code example:
60c5eb7d
XL
4
5```compile_fail,E0704
6mod foo {
7 pub(foo) struct Bar {
8 x: i32
9 }
10}
11```
12
13To make struct `Bar` only visible in module `foo` the `in` keyword should be
14used:
3dfed10e 15
60c5eb7d
XL
16```
17mod foo {
18 pub(in crate::foo) struct Bar {
19 x: i32
20 }
21}
22# fn main() {}
23```
24
25For more information see the Rust Reference on [Visibility].
26
27[Visibility]: https://doc.rust-lang.org/reference/visibility-and-privacy.html