]> git.proxmox.com Git - rustc.git/blobdiff - tests/ui/target-feature/invalid-attribute.rs
Update upstream source from tag 'upstream/1.70.0+dfsg1'
[rustc.git] / tests / ui / target-feature / invalid-attribute.rs
index ad1b6e96be6249e3184faace63c44be54d28e871..b59ed076f936c0d5d45a90eded55a6bd9ee12ab5 100644 (file)
@@ -6,7 +6,6 @@
 // ignore-mips64
 // ignore-powerpc
 // ignore-powerpc64
-// ignore-powerpc64le
 // ignore-riscv64
 // ignore-s390x
 // ignore-sparc
 
 #![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")]
@@ -59,6 +73,11 @@ union Qux {
     f2: u16,
 }
 
+#[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 {}
@@ -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();
 }