project_template/
another_mod.rs1pub(self) mod private_mod {
2 pub(super) mod pub_in_super {
3 pub(in crate::another_mod) fn pub_in_file() {
4 println!("called `pub_in_super::pub_in_file()`");
5 }
6
7 pub fn pub_in_anywhere() {
8 println!("called `pub_in_super::pub_in_anywhere()`");
9 }
10 }
11
12 pub use pub_in_super::pub_in_anywhere;
16
17 }
21
22#[allow(dead_code)]
23pub(crate) fn pub_in_crate() {
24 private_mod::pub_in_super::pub_in_file();
25 self::private_mod::pub_in_super::pub_in_file();
26 super::another_mod::private_mod::pub_in_super::pub_in_file();
27 crate::another_mod::private_mod::pub_in_super::pub_in_file();
28 self::private_mod::pub_in_super::pub_in_anywhere();
29 self::private_mod::pub_in_anywhere();
30 super::private_function();
31}
32
33#[cfg(test)]
35pub(self) mod tests {
36 #[test]
39 fn visibility() {
40 use super::pub_in_crate;
41 pub_in_crate();
42 }
45}