error[E0698]: incorrect visibility restriction --> $DIR/pub-restricted.rs:15:6 | LL | pub (a) fn afn() {} //~ incorrect visibility restriction | ^ help: make this visible only to module `a` with `in`: `in a` | = 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 error[E0698]: incorrect visibility restriction --> $DIR/pub-restricted.rs:16:6 | LL | pub (b) fn bfn() {} //~ incorrect visibility restriction | ^ help: make this visible only to module `b` with `in`: `in b` | = 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 error[E0698]: incorrect visibility restriction --> $DIR/pub-restricted.rs:32:14 | LL | pub (a) invalid: usize, //~ incorrect visibility restriction | ^ help: make this visible only to module `a` with `in`: `in a` | = 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 error[E0698]: incorrect visibility restriction --> $DIR/pub-restricted.rs:41:6 | LL | pub (xyz) fn xyz() {} //~ incorrect visibility restriction | ^^^ help: make this visible only to module `xyz` with `in`: `in 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 error: visibilities can only be restricted to ancestor modules --> $DIR/pub-restricted.rs:33:17 | LL | pub (in x) non_parent_invalid: usize, //~ ERROR visibilities can only be restricted | ^ error: aborting due to 5 previous errors For more information about this error, try `rustc --explain E0698`.