rust/tests/ui/lint/lint-unexported-no-mangle.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
497 B
Rust
Raw Normal View History

// compile-flags:-F private_no_mangle_fns -F no_mangle_const_items -F private_no_mangle_statics
2015-01-29 01:21:56 -06:00
#[no_mangle]
fn foo() {
2015-01-29 01:21:56 -06:00
}
#[allow(dead_code)]
#[no_mangle]
const FOO: u64 = 1; //~ ERROR const items should never be `#[no_mangle]`
#[no_mangle]
pub const PUB_FOO: u64 = 1; //~ ERROR const items should never be `#[no_mangle]`
2015-01-29 01:21:56 -06:00
#[no_mangle]
pub fn bar() {
}
#[no_mangle]
pub static BAR: u64 = 1;
#[allow(dead_code)]
#[no_mangle]
static PRIVATE_BAR: u64 = 1;
2015-01-29 01:21:56 -06:00
fn main() {
foo();
bar();
}