fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
2.6 KiB65 linesraw
1error[E0704]: incorrect visibility restriction
2  --> $DIR/pub-restricted.rs:5:6
3   |
4LL | pub (a) fn afn() {}
5   |      ^ help: make this visible only to module `a` with `in`: `in a`
6   |
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
11
12error[E0704]: incorrect visibility restriction
13  --> $DIR/pub-restricted.rs:6:6
14   |
15LL | pub (b) fn bfn() {}
16   |      ^ help: make this visible only to module `b` with `in`: `in b`
17   |
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
22
23error[E0704]: incorrect visibility restriction
24  --> $DIR/pub-restricted.rs:7:6
25   |
26LL | pub (crate::a) fn cfn() {}
27   |      ^^^^^^^^ help: make this visible only to module `crate::a` with `in`: `in crate::a`
28   |
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
33
34error[E0704]: incorrect visibility restriction
35  --> $DIR/pub-restricted.rs:24:14
36   |
37LL |         pub (a) invalid: usize,
38   |              ^ help: make this visible only to module `a` with `in`: `in a`
39   |
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
44
45error[E0704]: incorrect visibility restriction
46  --> $DIR/pub-restricted.rs:33:6
47   |
48LL | pub (xyz) fn xyz() {}
49   |      ^^^ help: make this visible only to module `xyz` with `in`: `in xyz`
50   |
51   = help: some possible visibility restrictions are:
52           `pub(crate)`: visible only on the current crate
53           `pub(super)`: visible only in the current module's parent
54           `pub(in path::to::module)`: visible only on the specified path
55
56error[E0742]: visibilities can only be restricted to ancestor modules
57  --> $DIR/pub-restricted.rs:25:17
58   |
59LL |         pub (in x) non_parent_invalid: usize,
60   |                 ^
61
62error: aborting due to 6 previous errors
63
64Some errors have detailed explanations: E0704, E0742.
65For more information about an error, try `rustc --explain E0704`.