@@ -21,7 +21,18 @@ LL | pub (b) fn bfn() {}
21
21
`pub(in path::to::module)`: visible only on the specified path
22
22
23
23
error[E0704]: incorrect visibility restriction
24
- --> $DIR/pub-restricted.rs:22:14
24
+ --> $DIR/pub-restricted.rs:7:6
25
+ |
26
+ LL | 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
+
34
+ error[E0704]: incorrect visibility restriction
35
+ --> $DIR/pub-restricted.rs:24:14
25
36
|
26
37
LL | pub (a) invalid: usize,
27
38
| ^ help: make this visible only to module `a` with `in`: `in a`
@@ -32,7 +43,7 @@ LL | pub (a) invalid: usize,
32
43
`pub(in path::to::module)`: visible only on the specified path
33
44
34
45
error[E0704]: incorrect visibility restriction
35
- --> $DIR/pub-restricted.rs:31 :6
46
+ --> $DIR/pub-restricted.rs:33 :6
36
47
|
37
48
LL | pub (xyz) fn xyz() {}
38
49
| ^^^ help: make this visible only to module `xyz` with `in`: `in xyz`
@@ -43,10 +54,10 @@ LL | pub (xyz) fn xyz() {}
43
54
`pub(in path::to::module)`: visible only on the specified path
44
55
45
56
error: visibilities can only be restricted to ancestor modules
46
- --> $DIR/pub-restricted.rs:23 :17
57
+ --> $DIR/pub-restricted.rs:25 :17
47
58
|
48
59
LL | pub (in x) non_parent_invalid: usize,
49
60
| ^
50
61
51
- error: aborting due to 5 previous errors
62
+ error: aborting due to 6 previous errors
52
63
0 commit comments