]> git.lizzy.rs Git - rust.git/blob - src/docs/redundant_pub_crate.txt
Auto merge of #9421 - xphoniex:fix-#9420, r=giraffate
[rust.git] / src / docs / redundant_pub_crate.txt
1 ### What it does
2 Checks for items declared `pub(crate)` that are not crate visible because they
3 are inside a private module.
4
5 ### Why is this bad?
6 Writing `pub(crate)` is misleading when it's redundant due to the parent
7 module's visibility.
8
9 ### Example
10 ```
11 mod internal {
12     pub(crate) fn internal_fn() { }
13 }
14 ```
15 This function is not visible outside the module and it can be declared with `pub` or
16 private visibility
17 ```
18 mod internal {
19     pub fn internal_fn() { }
20 }
21 ```