]> git.lizzy.rs Git - rust.git/blob - src/test/ui/privacy/access_levels.rs
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / privacy / access_levels.rs
1 #![feature(rustc_attrs)]
2
3 #[rustc_access_level] mod outer { //~ ERROR None
4     #[rustc_access_level] pub mod inner { //~ ERROR Some(Exported)
5         #[rustc_access_level]
6         extern "C" { //~ ERROR Some(Exported)
7             #[rustc_access_level] static a: u8; //~ ERROR None
8             #[rustc_access_level] pub fn b(); //~ ERROR Some(Exported)
9         }
10         #[rustc_access_level]
11         pub trait Trait { //~ ERROR Some(Exported)
12             #[rustc_access_level] const A: i32; //~ ERROR Some(Exported)
13             #[rustc_access_level] type B; //~ ERROR Some(Exported)
14         }
15
16         #[rustc_access_level]
17         pub struct Struct { //~ ERROR Some(Exported)
18             #[rustc_access_level] a: u8, //~ ERROR None
19             #[rustc_access_level] pub b: u8, //~ ERROR Some(Exported)
20         }
21
22         #[rustc_access_level]
23         pub union Union { //~ ERROR Some(Exported)
24             #[rustc_access_level] a: u8, //~ ERROR None
25             #[rustc_access_level] pub b: u8, //~ ERROR Some(Exported)
26         }
27
28         #[rustc_access_level]
29         pub enum Enum { //~ ERROR Some(Exported)
30             #[rustc_access_level] A( //~ ERROR Some(Exported)
31                 #[rustc_access_level] Struct, //~ ERROR Some(Exported)
32                 #[rustc_access_level] Union,  //~ ERROR Some(Exported)
33             ),
34         }
35     }
36
37     #[rustc_access_level] macro_rules! none_macro { //~ ERROR None
38         () => {};
39     }
40
41     #[macro_export]
42     #[rustc_access_level] macro_rules! public_macro { //~ ERROR Some(Public)
43         () => {};
44     }
45 }
46
47 pub use outer::inner;
48
49 fn main() {}