mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
29 lines
498 B
Rust
29 lines
498 B
Rust
//@ compile-flags:-F private_no_mangle_fns -F no_mangle_const_items -F private_no_mangle_statics
|
|
|
|
#[no_mangle]
|
|
fn foo() {
|
|
}
|
|
|
|
#[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]`
|
|
|
|
#[no_mangle]
|
|
pub fn bar() {
|
|
}
|
|
|
|
#[no_mangle]
|
|
pub static BAR: u64 = 1;
|
|
|
|
#[allow(dead_code)]
|
|
#[no_mangle]
|
|
static PRIVATE_BAR: u64 = 1;
|
|
|
|
|
|
fn main() {
|
|
foo();
|
|
bar();
|
|
}
|