diff --git a/tests/ui/ffi_const.rs b/tests/ui/ffi_const.rs index 7aeb5a49a1b..aa20a4d4c65 100644 --- a/tests/ui/ffi_const.rs +++ b/tests/ui/ffi_const.rs @@ -3,3 +3,13 @@ #[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; +} diff --git a/tests/ui/ffi_const.stderr b/tests/ui/ffi_const.stderr index bc3c12eaf98..394b98f8971 100644 --- a/tests/ui/ffi_const.stderr +++ b/tests/ui/ffi_const.stderr @@ -4,6 +4,18 @@ error[E0756]: `#[ffi_const]` may only be used on foreign functions LL | #[ffi_const] | ^^^^^^^^^^^^ -error: aborting due to previous error +error[E0756]: `#[ffi_const]` may only be used on foreign functions + --> $DIR/ffi_const.rs:7:1 + | +LL | #[ffi_const] + | ^^^^^^^^^^^^ + +error[E0756]: `#[ffi_const]` may only be used on foreign functions + --> $DIR/ffi_const.rs:13:5 + | +LL | #[ffi_const] + | ^^^^^^^^^^^^ + +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0756`. diff --git a/tests/ui/ffi_pure.rs b/tests/ui/ffi_pure.rs index c37d34c8784..6d2f3a614ec 100644 --- a/tests/ui/ffi_pure.rs +++ b/tests/ui/ffi_pure.rs @@ -3,3 +3,13 @@ #[ffi_pure] //~ ERROR `#[ffi_pure]` may only be used on foreign functions pub fn foo() {} + +#[ffi_pure] //~ ERROR `#[ffi_pure]` may only be used on foreign functions +macro_rules! bar { + () => () +} + +extern "C" { + #[ffi_pure] //~ ERROR `#[ffi_pure]` may only be used on foreign functions + static INT: i32; +} diff --git a/tests/ui/ffi_pure.stderr b/tests/ui/ffi_pure.stderr index bc911c85ddb..8b61a4b609f 100644 --- a/tests/ui/ffi_pure.stderr +++ b/tests/ui/ffi_pure.stderr @@ -4,6 +4,18 @@ error[E0755]: `#[ffi_pure]` may only be used on foreign functions LL | #[ffi_pure] | ^^^^^^^^^^^ -error: aborting due to previous error +error[E0755]: `#[ffi_pure]` may only be used on foreign functions + --> $DIR/ffi_pure.rs:7:1 + | +LL | #[ffi_pure] + | ^^^^^^^^^^^ + +error[E0755]: `#[ffi_pure]` may only be used on foreign functions + --> $DIR/ffi_pure.rs:13:5 + | +LL | #[ffi_pure] + | ^^^^^^^^^^^ + +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0755`. diff --git a/tests/ui/ffi_returns_twice.rs b/tests/ui/ffi_returns_twice.rs index 845e18df11b..8195d0e4863 100644 --- a/tests/ui/ffi_returns_twice.rs +++ b/tests/ui/ffi_returns_twice.rs @@ -3,3 +3,13 @@ #[ffi_returns_twice] //~ ERROR `#[ffi_returns_twice]` may only be used on foreign functions pub fn foo() {} + +#[ffi_returns_twice] //~ ERROR `#[ffi_returns_twice]` may only be used on foreign functions +macro_rules! bar { + () => () +} + +extern "C" { + #[ffi_returns_twice] //~ ERROR `#[ffi_returns_twice]` may only be used on foreign functions + static INT: i32; +} diff --git a/tests/ui/ffi_returns_twice.stderr b/tests/ui/ffi_returns_twice.stderr index 2b7f5694f02..0abe7613f14 100644 --- a/tests/ui/ffi_returns_twice.stderr +++ b/tests/ui/ffi_returns_twice.stderr @@ -4,6 +4,18 @@ error[E0724]: `#[ffi_returns_twice]` may only be used on foreign functions LL | #[ffi_returns_twice] | ^^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error +error[E0724]: `#[ffi_returns_twice]` may only be used on foreign functions + --> $DIR/ffi_returns_twice.rs:7:1 + | +LL | #[ffi_returns_twice] + | ^^^^^^^^^^^^^^^^^^^^ + +error[E0724]: `#[ffi_returns_twice]` may only be used on foreign functions + --> $DIR/ffi_returns_twice.rs:13:5 + | +LL | #[ffi_returns_twice] + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0724`.