1 error[E0704]: incorrect visibility restriction
2 --> $DIR/pub-restricted.rs:15:6
4 LL | pub (a) fn afn() {} //~ incorrect visibility restriction
5 | ^ help: make this visible only to module `a` with `in`: `in a`
7 = help: some possible visibility restrictions are:
8 `pub(crate)`: visible only on the current crate
9 `pub(super)`: visible only in the current module's parent
10 `pub(in path::to::module)`: visible only on the specified path
12 error[E0704]: incorrect visibility restriction
13 --> $DIR/pub-restricted.rs:16:6
15 LL | pub (b) fn bfn() {} //~ incorrect visibility restriction
16 | ^ help: make this visible only to module `b` with `in`: `in b`
18 = help: some possible visibility restrictions are:
19 `pub(crate)`: visible only on the current crate
20 `pub(super)`: visible only in the current module's parent
21 `pub(in path::to::module)`: visible only on the specified path
23 error[E0704]: incorrect visibility restriction
24 --> $DIR/pub-restricted.rs:32:14
26 LL | pub (a) invalid: usize, //~ incorrect visibility restriction
27 | ^ help: make this visible only to module `a` with `in`: `in a`
29 = help: some possible visibility restrictions are:
30 `pub(crate)`: visible only on the current crate
31 `pub(super)`: visible only in the current module's parent
32 `pub(in path::to::module)`: visible only on the specified path
34 error[E0704]: incorrect visibility restriction
35 --> $DIR/pub-restricted.rs:41:6
37 LL | pub (xyz) fn xyz() {} //~ incorrect visibility restriction
38 | ^^^ help: make this visible only to module `xyz` with `in`: `in xyz`
40 = help: some possible visibility restrictions are:
41 `pub(crate)`: visible only on the current crate
42 `pub(super)`: visible only in the current module's parent
43 `pub(in path::to::module)`: visible only on the specified path
45 error: visibilities can only be restricted to ancestor modules
46 --> $DIR/pub-restricted.rs:33:17
48 LL | pub (in x) non_parent_invalid: usize, //~ ERROR visibilities can only be restricted
51 error: aborting due to 5 previous errors
53 For more information about this error, try `rustc --explain E0704`.