File: pub-restricted.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (85 lines) | stat: -rw-r--r-- 2,860 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
error[E0704]: incorrect visibility restriction
  --> $DIR/pub-restricted.rs:3:6
   |
LL | pub (a) fn afn() {}
   |      ^
   |
   = 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
help: make this visible only to module `a` with `in`
   |
LL | pub (in a) fn afn() {}
   |      ~~~~

error[E0704]: incorrect visibility restriction
  --> $DIR/pub-restricted.rs:4:6
   |
LL | pub (b) fn bfn() {}
   |      ^
   |
   = 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
help: make this visible only to module `b` with `in`
   |
LL | pub (in b) fn bfn() {}
   |      ~~~~

error[E0704]: incorrect visibility restriction
  --> $DIR/pub-restricted.rs:5:6
   |
LL | pub (crate::a) fn cfn() {}
   |      ^^^^^^^^
   |
   = 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
help: make this visible only to module `crate::a` with `in`
   |
LL | pub (in crate::a) fn cfn() {}
   |      ~~~~~~~~~~~

error[E0704]: incorrect visibility restriction
  --> $DIR/pub-restricted.rs:22:14
   |
LL |         pub (a) invalid: usize,
   |              ^
   |
   = 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
help: make this visible only to module `a` with `in`
   |
LL |         pub (in a) invalid: usize,
   |              ~~~~

error[E0704]: incorrect visibility restriction
  --> $DIR/pub-restricted.rs:31:6
   |
LL | pub (xyz) fn xyz() {}
   |      ^^^
   |
   = 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
help: make this visible only to module `xyz` with `in`
   |
LL | pub (in xyz) fn xyz() {}
   |      ~~~~~~

error[E0742]: visibilities can only be restricted to ancestor modules
  --> $DIR/pub-restricted.rs:23:17
   |
LL |         pub (in x) non_parent_invalid: usize,
   |                 ^

error: aborting due to 6 previous errors

Some errors have detailed explanations: E0704, E0742.
For more information about an error, try `rustc --explain E0704`.