Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
29 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,4 +34,8 @@ mod y { | |
} | ||
} | ||
|
||
fn main() {} | ||
fn main() {} | ||
|
||
// test multichar names | ||
mod xyz {} | ||
pub (xyz) fn xyz() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,52 @@ | ||
error: incorrect visibility restriction | ||
--> $DIR/pub-restricted.rs:15:5 | ||
--> $DIR/pub-restricted.rs:15:6 | ||
| | ||
15 | pub (a) fn afn() {} | ||
| ^^^ | ||
| ^ to make this visible only to module `a`, add `in` before the path: `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 | ||
help: to make this visible only to module `a`, add `in` before the path: | ||
| pub (in a) fn afn() {} | ||
|
||
error: incorrect visibility restriction | ||
--> $DIR/pub-restricted.rs:16:5 | ||
--> $DIR/pub-restricted.rs:16:6 | ||
| | ||
16 | pub (b) fn bfn() {} | ||
| ^^^ | ||
| ^ to make this visible only to module `b`, add `in` before the path: `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 | ||
help: to make this visible only to module `b`, add `in` before the path: | ||
| pub (in b) fn bfn() {} | ||
|
||
error: incorrect visibility restriction | ||
--> $DIR/pub-restricted.rs:32:13 | ||
--> $DIR/pub-restricted.rs:32:14 | ||
| | ||
32 | pub (a) invalid: usize, | ||
| ^^^ | ||
| ^ to make this visible only to module `a`, add `in` before the path: `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: incorrect visibility restriction | ||
--> $DIR/pub-restricted.rs:41:6 | ||
| | ||
41 | pub (xyz) fn xyz() {} | ||
| ^^^ to make this visible only to module `xyz`, add `in` before the path: `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 | ||
help: to make this visible only to module `a`, add `in` before the path: | ||
| pub (in a) invalid: usize, | ||
|
||
error: visibilities can only be restricted to ancestor modules | ||
--> $DIR/pub-restricted.rs:33:17 | ||
| | ||
33 | pub (in x) non_parent_invalid: usize, | ||
| ^ | ||
|
||
error: aborting due to 4 previous errors | ||
error: aborting due to 5 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters