about summary refs log tree commit diff
path: root/tests/ui/target-feature/invalid-attribute.rs
diff options
context:
space:
mode:
authorJana Dönszelmann <jonathan@donsz.nl>2025-07-03 13:29:36 +0200
committerGitHub <noreply@github.com>2025-07-03 13:29:36 +0200
commit5026d0cd8e45d2c882d1161edcb6c40e97c87a1a (patch)
treed561b00af759a4764087e1f9dae43dc19b930d16 /tests/ui/target-feature/invalid-attribute.rs
parentf6d37a25a96fd2c20f4349474d81bbb35e2ecba3 (diff)
parent3d5d72b76105056af5886cbad4661a26f9409b8e (diff)
downloadrust-5026d0cd8e45d2c882d1161edcb6c40e97c87a1a.tar.gz
rust-5026d0cd8e45d2c882d1161edcb6c40e97c87a1a.zip
Rollup merge of #142876 - JonathanBrouwer:target_feature_parser, r=oli-obk
Port `#[target_feature]` to new attribute parsing infrastructure

Ports `target_feature` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197

r? ``@jdonszelmann``
Diffstat (limited to 'tests/ui/target-feature/invalid-attribute.rs')
-rw-r--r--tests/ui/target-feature/invalid-attribute.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/target-feature/invalid-attribute.rs b/tests/ui/target-feature/invalid-attribute.rs
index 9ef7a686d25..d13098c3a6a 100644
--- a/tests/ui/target-feature/invalid-attribute.rs
+++ b/tests/ui/target-feature/invalid-attribute.rs
@@ -19,13 +19,16 @@ extern "Rust" {}
 
 #[target_feature = "+sse2"]
 //~^ ERROR malformed `target_feature` attribute
+//~| NOTE expected this to be a list
 #[target_feature(enable = "foo")]
 //~^ ERROR not valid for this target
 //~| NOTE `foo` is not valid for this target
 #[target_feature(bar)]
 //~^ ERROR malformed `target_feature` attribute
+//~| NOTE expected this to be of the form `enable = "..."`
 #[target_feature(disable = "baz")]
 //~^ ERROR malformed `target_feature` attribute
+//~| NOTE expected this to be of the form `enable = "..."`
 unsafe fn foo() {}
 
 #[target_feature(enable = "sse2")]
@@ -117,3 +120,8 @@ fn main() {
     || {};
     //~^ NOTE not a function
 }
+
+#[target_feature(enable = "+sse2")]
+//~^ ERROR `+sse2` is not valid for this target
+//~| NOTE `+sse2` is not valid for this target
+unsafe fn hey() {}