about summary refs log tree commit diff
path: root/tests/ui/ffi-attrs/ffi_const.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/ffi-attrs/ffi_const.rs')
-rw-r--r--tests/ui/ffi-attrs/ffi_const.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/ffi-attrs/ffi_const.rs b/tests/ui/ffi-attrs/ffi_const.rs
new file mode 100644
index 00000000000..aa20a4d4c65
--- /dev/null
+++ b/tests/ui/ffi-attrs/ffi_const.rs
@@ -0,0 +1,15 @@
+#![feature(ffi_const)]
+#![crate_type = "lib"]
+
+#[ffi_const] //~ ERROR `#[ffi_const]` may only be used on foreign functions
+pub fn foo() {}
+
+#[ffi_const] //~ ERROR `#[ffi_const]` may only be used on foreign functions
+macro_rules! bar {
+    () => ()
+}
+
+extern "C" {
+    #[ffi_const] //~ ERROR `#[ffi_const]` may only be used on foreign functions
+    static INT: i32;
+}