11error: malformed `target_feature` attribute input
2-   --> $DIR/invalid-attribute.rs:17 :1
2+   --> $DIR/invalid-attribute.rs:32 :1
33   |
44LL | #[target_feature = "+sse2"]
55   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[target_feature(enable = "name")]`
66
77error: attribute should be applied to a function definition
8-   --> $DIR/invalid-attribute.rs:34:1
8+   --> $DIR/invalid-attribute.rs:17:1
9+    |
10+ LL | #[target_feature(enable = "sse2")]
11+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+ LL |
13+ LL | extern crate alloc;
14+    | ------------------- not a function definition
15+ 
16+ error: attribute should be applied to a function definition
17+   --> $DIR/invalid-attribute.rs:22:1
18+    |
19+ LL | #[target_feature(enable = "sse2")]
20+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21+ LL |
22+ LL | use alloc::alloc::alloc;
23+    | ------------------------ not a function definition
24+ 
25+ error: attribute should be applied to a function definition
26+   --> $DIR/invalid-attribute.rs:27:1
27+    |
28+ LL | #[target_feature(enable = "sse2")]
29+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30+ LL |
31+ LL | extern "Rust" {}
32+    | ---------------- not a function definition
33+ 
34+ error: attribute should be applied to a function definition
35+   --> $DIR/invalid-attribute.rs:49:1
936   |
1037LL | #[target_feature(enable = "sse2")]
1138   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -14,7 +41,7 @@ LL | mod another {}
1441   | -------------- not a function definition
1542
1643error: attribute should be applied to a function definition
17-   --> $DIR/invalid-attribute.rs:39 :1
44+   --> $DIR/invalid-attribute.rs:54 :1
1845   |
1946LL | #[target_feature(enable = "sse2")]
2047   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -23,7 +50,7 @@ LL | const FOO: usize = 7;
2350   | --------------------- not a function definition
2451
2552error: attribute should be applied to a function definition
26-   --> $DIR/invalid-attribute.rs:44 :1
53+   --> $DIR/invalid-attribute.rs:59 :1
2754   |
2855LL | #[target_feature(enable = "sse2")]
2956   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -32,7 +59,7 @@ LL | struct Foo;
3259   | ----------- not a function definition
3360
3461error: attribute should be applied to a function definition
35-   --> $DIR/invalid-attribute.rs:49 :1
62+   --> $DIR/invalid-attribute.rs:64 :1
3663   |
3764LL | #[target_feature(enable = "sse2")]
3865   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -41,7 +68,7 @@ LL | enum Bar {}
4168   | ----------- not a function definition
4269
4370error: attribute should be applied to a function definition
44-   --> $DIR/invalid-attribute.rs:54 :1
71+   --> $DIR/invalid-attribute.rs:69 :1
4572   |
4673LL |   #[target_feature(enable = "sse2")]
4774   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -54,7 +81,16 @@ LL | | }
5481   | |_- not a function definition
5582
5683error: attribute should be applied to a function definition
57-   --> $DIR/invalid-attribute.rs:62:1
84+   --> $DIR/invalid-attribute.rs:77:1
85+    |
86+ LL | #[target_feature(enable = "sse2")]
87+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
88+ LL |
89+ LL | type Uwu = ();
90+    | -------------- not a function definition
91+ 
92+ error: attribute should be applied to a function definition
93+   --> $DIR/invalid-attribute.rs:82:1
5894   |
5995LL | #[target_feature(enable = "sse2")]
6096   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -63,7 +99,34 @@ LL | trait Baz {}
6399   | ------------ not a function definition
64100
65101error: attribute should be applied to a function definition
66-   --> $DIR/invalid-attribute.rs:85:5
102+   --> $DIR/invalid-attribute.rs:92:1
103+    |
104+ LL | #[target_feature(enable = "sse2")]
105+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
106+ LL |
107+ LL | static A: () = ();
108+    | ------------------ not a function definition
109+ 
110+ error: attribute should be applied to a function definition
111+   --> $DIR/invalid-attribute.rs:97:1
112+    |
113+ LL | #[target_feature(enable = "sse2")]
114+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
115+ LL |
116+ LL | impl Quux for u8 {}
117+    | ------------------- not a function definition
118+ 
119+ error: attribute should be applied to a function definition
120+   --> $DIR/invalid-attribute.rs:102:1
121+    |
122+ LL | #[target_feature(enable = "sse2")]
123+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
124+ LL |
125+ LL | impl Foo {}
126+    | ----------- not a function definition
127+ 
128+ error: attribute should be applied to a function definition
129+   --> $DIR/invalid-attribute.rs:120:5
67130   |
68131LL |       #[target_feature(enable = "sse2")]
69132   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -75,7 +138,7 @@ LL | |     }
75138   | |_____- not a function definition
76139
77140error: attribute should be applied to a function definition
78-   --> $DIR/invalid-attribute.rs:93 :5
141+   --> $DIR/invalid-attribute.rs:128 :5
79142   |
80143LL |     #[target_feature(enable = "sse2")]
81144   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -84,25 +147,25 @@ LL |     || {};
84147   |     ----- not a function definition
85148
86149error: the feature named `foo` is not valid for this target
87-   --> $DIR/invalid-attribute.rs:19 :18
150+   --> $DIR/invalid-attribute.rs:34 :18
88151   |
89152LL | #[target_feature(enable = "foo")]
90153   |                  ^^^^^^^^^^^^^^ `foo` is not valid for this target
91154
92155error: malformed `target_feature` attribute input
93-   --> $DIR/invalid-attribute.rs:22 :18
156+   --> $DIR/invalid-attribute.rs:37 :18
94157   |
95158LL | #[target_feature(bar)]
96159   |                  ^^^ help: must be of the form: `enable = ".."`
97160
98161error: malformed `target_feature` attribute input
99-   --> $DIR/invalid-attribute.rs:24 :18
162+   --> $DIR/invalid-attribute.rs:39 :18
100163   |
101164LL | #[target_feature(disable = "baz")]
102165   |                  ^^^^^^^^^^^^^^^ help: must be of the form: `enable = ".."`
103166
104167error[E0658]: `#[target_feature(..)]` can only be applied to `unsafe` functions
105-   --> $DIR/invalid-attribute.rs:28 :1
168+   --> $DIR/invalid-attribute.rs:43 :1
106169   |
107170LL | #[target_feature(enable = "sse2")]
108171   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -114,13 +177,13 @@ LL | fn bar() {}
114177   = help: add `#![feature(target_feature_11)]` to the crate attributes to enable
115178
116179error: cannot use `#[inline(always)]` with `#[target_feature]`
117-   --> $DIR/invalid-attribute.rs:67 :1
180+   --> $DIR/invalid-attribute.rs:87 :1
118181   |
119182LL | #[inline(always)]
120183   | ^^^^^^^^^^^^^^^^^
121184
122185error[E0658]: `#[target_feature(..)]` can only be applied to `unsafe` functions
123-   --> $DIR/invalid-attribute.rs:77 :5
186+   --> $DIR/invalid-attribute.rs:112 :5
124187   |
125188LL |     #[target_feature(enable = "sse2")]
126189   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -131,6 +194,6 @@ LL |     fn foo() {}
131194   = note: see issue #69098 <https://github.com/rust-lang/rust/issues/69098> for more information
132195   = help: add `#![feature(target_feature_11)]` to the crate attributes to enable
133196
134- error: aborting due to 15  previous errors
197+ error: aborting due to 22  previous errors
135198
136199For more information about this error, try `rustc --explain E0658`.
0 commit comments