@@ -21,7 +21,18 @@ LL | pub (b) fn bfn() {}
2121 `pub(in path::to::module)`: visible only on the specified path
2222
2323error[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
2536 |
2637LL | pub (a) invalid: usize,
2738 | ^ help: make this visible only to module `a` with `in`: `in a`
@@ -32,7 +43,7 @@ LL | pub (a) invalid: usize,
3243 `pub(in path::to::module)`: visible only on the specified path
3344
3445error[E0704]: incorrect visibility restriction
35- --> $DIR/pub-restricted.rs:31 :6
46+ --> $DIR/pub-restricted.rs:33 :6
3647 |
3748LL | pub (xyz) fn xyz() {}
3849 | ^^^ help: make this visible only to module `xyz` with `in`: `in xyz`
@@ -43,10 +54,10 @@ LL | pub (xyz) fn xyz() {}
4354 `pub(in path::to::module)`: visible only on the specified path
4455
4556error: visibilities can only be restricted to ancestor modules
46- --> $DIR/pub-restricted.rs:23 :17
57+ --> $DIR/pub-restricted.rs:25 :17
4758 |
4859LL | pub (in x) non_parent_invalid: usize,
4960 | ^
5061
51- error: aborting due to 5 previous errors
62+ error: aborting due to 6 previous errors
5263
0 commit comments