mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
30 lines
497 B
Rust
30 lines
497 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();
|
|
}
|