
the `no_mangle`, `link_section` and `export_name` attributes are exceptions, and can still be used without an unsafe in earlier editions
18 lines
471 B
Rust
18 lines
471 B
Rust
#![feature(ffi_const)]
|
|
#![crate_type = "lib"]
|
|
|
|
#[unsafe(ffi_const)] //~ ERROR `#[ffi_const]` may only be used on foreign functions
|
|
pub fn foo() {}
|
|
|
|
#[unsafe(ffi_const)] //~ ERROR `#[ffi_const]` may only be used on foreign functions
|
|
macro_rules! bar {
|
|
() => {};
|
|
}
|
|
|
|
extern "C" {
|
|
#[unsafe(ffi_const)] //~ ERROR `#[ffi_const]` may only be used on foreign functions
|
|
static INT: i32;
|
|
|
|
#[ffi_const] //~ ERROR unsafe attribute used without unsafe
|
|
fn bar();
|
|
}
|