]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/lint-unexported-no-mangle.rs
Handle `#[expect(unfulfilled_lint_expectations)]` with a lint message
[rust.git] / src / test / ui / lint / lint-unexported-no-mangle.rs
1 // compile-flags:-F private_no_mangle_fns -F no_mangle_const_items -F private_no_mangle_statics
2
3 #[no_mangle]
4 fn foo() {
5 }
6
7 #[allow(dead_code)]
8 #[no_mangle]
9 const FOO: u64 = 1; //~ ERROR const items should never be `#[no_mangle]`
10
11 #[no_mangle]
12 pub const PUB_FOO: u64 = 1; //~ ERROR const items should never be `#[no_mangle]`
13
14 #[no_mangle]
15 pub fn bar()  {
16 }
17
18 #[no_mangle]
19 pub static BAR: u64 = 1;
20
21 #[allow(dead_code)]
22 #[no_mangle]
23 static PRIVATE_BAR: u64 = 1;
24
25
26 fn main() {
27     foo();
28     bar();
29 }