mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 10:18:25 +00:00

the `no_mangle`, `link_section` and `export_name` attributes are exceptions, and can still be used without an unsafe in earlier editions
12 lines
211 B
Rust
12 lines
211 B
Rust
#![feature(ffi_const, ffi_pure)]
|
|
|
|
extern "C" {
|
|
#[unsafe(ffi_pure)] //~ ERROR `#[ffi_const]` function cannot be `#[ffi_pure]`
|
|
#[unsafe(ffi_const)]
|
|
pub fn baz();
|
|
}
|
|
|
|
fn main() {
|
|
unsafe { baz() };
|
|
}
|