diff options
Diffstat (limited to 'tests/ui/target-feature/invalid-attribute.rs')
-rw-r--r-- | tests/ui/target-feature/invalid-attribute.rs | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/tests/ui/target-feature/invalid-attribute.rs b/tests/ui/target-feature/invalid-attribute.rs index ad1b6e96b..b59ed076f 100644 --- a/tests/ui/target-feature/invalid-attribute.rs +++ b/tests/ui/target-feature/invalid-attribute.rs @@ -6,7 +6,6 @@ // ignore-mips64 // ignore-powerpc // ignore-powerpc64 -// ignore-powerpc64le // ignore-riscv64 // ignore-s390x // ignore-sparc @@ -14,6 +13,21 @@ #![warn(unused_attributes)] +#[target_feature(enable = "sse2")] +//~^ ERROR attribute should be applied to a function +extern crate alloc; +//~^ NOTE not a function + +#[target_feature(enable = "sse2")] +//~^ ERROR attribute should be applied to a function +use alloc::alloc::alloc; +//~^ NOTE not a function + +#[target_feature(enable = "sse2")] +//~^ ERROR attribute should be applied to a function +extern "Rust" {} +//~^ NOTE not a function + #[target_feature = "+sse2"] //~^ ERROR malformed `target_feature` attribute #[target_feature(enable = "foo")] @@ -61,6 +75,11 @@ union Qux { #[target_feature(enable = "sse2")] //~^ ERROR attribute should be applied to a function +type Uwu = (); +//~^ NOTE not a function + +#[target_feature(enable = "sse2")] +//~^ ERROR attribute should be applied to a function trait Baz {} //~^ NOTE not a function @@ -69,6 +88,21 @@ trait Baz {} #[target_feature(enable = "sse2")] unsafe fn test() {} +#[target_feature(enable = "sse2")] +//~^ ERROR attribute should be applied to a function +static A: () = (); +//~^ NOTE not a function + +#[target_feature(enable = "sse2")] +//~^ ERROR attribute should be applied to a function +impl Quux for u8 {} +//~^ NOTE not a function + +#[target_feature(enable = "sse2")] +//~^ ERROR attribute should be applied to a function +impl Foo {} +//~^ NOTE not a function + trait Quux { fn foo(); } |