about summary refs log tree commit diff
path: root/tests/ui/ffi-attrs/ffi_const.rs
blob: caeaf8a25a9c52feaff6d942cecc2f2d826528a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![feature(ffi_const)]
#![crate_type = "lib"]

#[unsafe(ffi_const)] //~ ERROR attribute cannot be used on
pub fn foo() {}

#[unsafe(ffi_const)] //~ ERROR attribute cannot be used on
macro_rules! bar {
    () => {};
}

extern "C" {
    #[unsafe(ffi_const)] //~ ERROR attribute cannot be used on
    static INT: i32;

    #[ffi_const] //~ ERROR unsafe attribute used without unsafe
    fn bar();
}