2025-06-25 09:47:48 +02:00
|
|
|
error[E0539]: malformed `target_feature` attribute input
|
2023-07-29 14:57:53 -07:00
|
|
|
--> $DIR/invalid-attribute.rs:20:1
|
2019-09-26 11:00:53 +01:00
|
|
|
|
|
|
|
|
|
LL | #[target_feature = "+sse2"]
|
2025-06-25 09:47:48 +02:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
| |
|
|
|
|
|
| expected this to be a list
|
|
|
|
|
| help: must be of the form: `#[target_feature(enable = "feat1, feat2")]`
|
|
|
|
|
|
|
|
|
|
error[E0539]: malformed `target_feature` attribute input
|
|
|
|
|
--> $DIR/invalid-attribute.rs:26:1
|
|
|
|
|
|
|
|
|
|
|
LL | #[target_feature(bar)]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^---^^
|
|
|
|
|
| | |
|
|
|
|
|
| | expected this to be of the form `enable = "..."`
|
|
|
|
|
| help: must be of the form: `#[target_feature(enable = "feat1, feat2")]`
|
|
|
|
|
|
|
|
|
|
error[E0539]: malformed `target_feature` attribute input
|
|
|
|
|
--> $DIR/invalid-attribute.rs:29:1
|
|
|
|
|
|
|
|
|
|
|
LL | #[target_feature(disable = "baz")]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^-------^^^^^^^^^^
|
|
|
|
|
| | |
|
|
|
|
|
| | expected this to be of the form `enable = "..."`
|
|
|
|
|
| help: must be of the form: `#[target_feature(enable = "feat1, feat2")]`
|
2019-09-26 11:00:53 +01:00
|
|
|
|
2022-07-11 18:59:04 +01:00
|
|
|
error: attribute should be applied to a function definition
|
2023-07-29 14:57:53 -07:00
|
|
|
--> $DIR/invalid-attribute.rs:5:1
|
2023-03-13 18:32:25 +00:00
|
|
|
|
|
|
|
|
|
LL | #[target_feature(enable = "sse2")]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
LL |
|
|
|
|
|
LL | extern crate alloc;
|
|
|
|
|
| ------------------- not a function definition
|
|
|
|
|
|
|
|
|
|
error: attribute should be applied to a function definition
|
2023-07-29 14:57:53 -07:00
|
|
|
--> $DIR/invalid-attribute.rs:10:1
|
2023-03-13 18:32:25 +00:00
|
|
|
|
|
|
|
|
|
LL | #[target_feature(enable = "sse2")]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
LL |
|
|
|
|
|
LL | use alloc::alloc::alloc;
|
|
|
|
|
| ------------------------ not a function definition
|
|
|
|
|
|
|
|
|
|
error: attribute should be applied to a function definition
|
2023-07-29 14:57:53 -07:00
|
|
|
--> $DIR/invalid-attribute.rs:15:1
|
2023-03-13 18:32:25 +00:00
|
|
|
|
|
|
|
|
|
LL | #[target_feature(enable = "sse2")]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
LL |
|
|
|
|
|
LL | extern "Rust" {}
|
|
|
|
|
| ---------------- not a function definition
|
|
|
|
|
|
|
|
|
|
error: attribute should be applied to a function definition
|
2025-06-25 09:47:48 +02:00
|
|
|
--> $DIR/invalid-attribute.rs:34:1
|
2019-09-26 11:00:53 +01:00
|
|
|
|
|
|
|
|
|
LL | #[target_feature(enable = "sse2")]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
LL |
|
|
|
|
|
LL | mod another {}
|
2022-07-11 18:59:04 +01:00
|
|
|
| -------------- not a function definition
|
2019-09-26 11:00:53 +01:00
|
|
|
|
2022-07-11 18:59:04 +01:00
|
|
|
error: attribute should be applied to a function definition
|
2025-06-25 09:47:48 +02:00
|
|
|
--> $DIR/invalid-attribute.rs:39:1
|
2019-09-26 11:00:53 +01:00
|
|
|
|
|
|
|
|
|
LL | #[target_feature(enable = "sse2")]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
LL |
|
|
|
|
|
LL | const FOO: usize = 7;
|
2022-07-11 18:59:04 +01:00
|
|
|
| --------------------- not a function definition
|
2019-09-26 11:00:53 +01:00
|
|
|
|
2022-07-11 18:59:04 +01:00
|
|
|
error: attribute should be applied to a function definition
|
2025-06-25 09:47:48 +02:00
|
|
|
--> $DIR/invalid-attribute.rs:44:1
|
2019-09-26 11:00:53 +01:00
|
|
|
|
|
|
|
|
|
LL | #[target_feature(enable = "sse2")]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
LL |
|
|
|
|
|
LL | struct Foo;
|
2022-07-11 18:59:04 +01:00
|
|
|
| ----------- not a function definition
|
2019-09-26 11:00:53 +01:00
|
|
|
|
2022-07-11 18:59:04 +01:00
|
|
|
error: attribute should be applied to a function definition
|
2025-06-25 09:47:48 +02:00
|
|
|
--> $DIR/invalid-attribute.rs:49:1
|
2019-09-26 11:00:53 +01:00
|
|
|
|
|
|
|
|
|
LL | #[target_feature(enable = "sse2")]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
LL |
|
2020-07-11 10:29:35 -04:00
|
|
|
LL | enum Bar {}
|
2022-07-11 18:59:04 +01:00
|
|
|
| ----------- not a function definition
|
2019-09-26 11:00:53 +01:00
|
|
|
|
2022-07-11 18:59:04 +01:00
|
|
|
error: attribute should be applied to a function definition
|
2025-06-25 09:47:48 +02:00
|
|
|
--> $DIR/invalid-attribute.rs:54:1
|
2019-09-26 11:00:53 +01:00
|
|
|
|
|
2020-07-11 10:29:35 -04:00
|
|
|
LL | #[target_feature(enable = "sse2")]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2019-09-26 11:00:53 +01:00
|
|
|
LL |
|
2020-07-11 10:29:35 -04:00
|
|
|
LL | / union Qux {
|
|
|
|
|
LL | |
|
|
|
|
|
LL | | f1: u16,
|
|
|
|
|
LL | | f2: u16,
|
|
|
|
|
LL | | }
|
2022-07-11 18:59:04 +01:00
|
|
|
| |_- not a function definition
|
2019-09-26 11:00:53 +01:00
|
|
|
|
2022-07-11 18:59:04 +01:00
|
|
|
error: attribute should be applied to a function definition
|
2025-06-25 09:47:48 +02:00
|
|
|
--> $DIR/invalid-attribute.rs:62:1
|
2023-03-13 18:32:25 +00:00
|
|
|
|
|
|
|
|
|
LL | #[target_feature(enable = "sse2")]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
LL |
|
|
|
|
|
LL | type Uwu = ();
|
|
|
|
|
| -------------- not a function definition
|
|
|
|
|
|
|
|
|
|
error: attribute should be applied to a function definition
|
2025-06-25 09:47:48 +02:00
|
|
|
--> $DIR/invalid-attribute.rs:67:1
|
2019-09-26 11:00:53 +01:00
|
|
|
|
|
|
|
|
|
LL | #[target_feature(enable = "sse2")]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
LL |
|
2020-07-11 10:29:35 -04:00
|
|
|
LL | trait Baz {}
|
2022-07-11 18:59:04 +01:00
|
|
|
| ------------ not a function definition
|
2019-09-26 11:00:53 +01:00
|
|
|
|
2025-03-22 22:29:23 +01:00
|
|
|
error: cannot use `#[inline(always)]` with `#[target_feature]`
|
2025-06-25 09:47:48 +02:00
|
|
|
--> $DIR/invalid-attribute.rs:72:1
|
2025-03-22 22:29:23 +01:00
|
|
|
|
|
|
|
|
|
LL | #[inline(always)]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2022-07-11 18:59:04 +01:00
|
|
|
error: attribute should be applied to a function definition
|
2025-06-25 09:47:48 +02:00
|
|
|
--> $DIR/invalid-attribute.rs:77:1
|
2023-03-13 18:32:25 +00:00
|
|
|
|
|
|
|
|
|
LL | #[target_feature(enable = "sse2")]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
LL |
|
|
|
|
|
LL | static A: () = ();
|
|
|
|
|
| ------------------ not a function definition
|
|
|
|
|
|
|
|
|
|
error: attribute should be applied to a function definition
|
2025-06-25 09:47:48 +02:00
|
|
|
--> $DIR/invalid-attribute.rs:82:1
|
2023-03-13 18:32:25 +00:00
|
|
|
|
|
|
|
|
|
LL | #[target_feature(enable = "sse2")]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
LL |
|
|
|
|
|
LL | impl Quux for u8 {}
|
|
|
|
|
| ------------------- not a function definition
|
|
|
|
|
|
|
|
|
|
error: attribute should be applied to a function definition
|
2025-06-25 09:47:48 +02:00
|
|
|
--> $DIR/invalid-attribute.rs:89:1
|
2023-03-13 18:32:25 +00:00
|
|
|
|
|
|
|
|
|
LL | #[target_feature(enable = "sse2")]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
LL |
|
|
|
|
|
LL | impl Foo {}
|
|
|
|
|
| ----------- not a function definition
|
|
|
|
|
|
|
|
|
|
error: attribute should be applied to a function definition
|
2025-06-25 09:47:48 +02:00
|
|
|
--> $DIR/invalid-attribute.rs:111:5
|
2020-06-14 00:47:42 -04:00
|
|
|
|
|
|
|
|
|
LL | #[target_feature(enable = "sse2")]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
LL |
|
|
|
|
|
LL | / unsafe {
|
|
|
|
|
LL | | foo();
|
|
|
|
|
LL | | }
|
2022-07-11 18:59:04 +01:00
|
|
|
| |_____- not a function definition
|
2020-06-14 00:47:42 -04:00
|
|
|
|
2022-07-11 18:59:04 +01:00
|
|
|
error: attribute should be applied to a function definition
|
2025-06-25 09:47:48 +02:00
|
|
|
--> $DIR/invalid-attribute.rs:118:5
|
2020-04-16 17:11:05 +02:00
|
|
|
|
|
|
|
|
|
LL | #[target_feature(enable = "sse2")]
|
2020-05-01 15:32:28 +02:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-06-14 00:47:42 -04:00
|
|
|
LL |
|
2020-04-16 17:11:05 +02:00
|
|
|
LL | || {};
|
2022-07-11 18:59:04 +01:00
|
|
|
| ----- not a function definition
|
2020-04-16 17:11:05 +02:00
|
|
|
|
2022-11-06 16:28:07 +00:00
|
|
|
error: the feature named `foo` is not valid for this target
|
2025-06-25 09:47:48 +02:00
|
|
|
--> $DIR/invalid-attribute.rs:23:18
|
2022-11-06 16:28:07 +00:00
|
|
|
|
|
|
|
|
|
LL | #[target_feature(enable = "foo")]
|
|
|
|
|
| ^^^^^^^^^^^^^^ `foo` is not valid for this target
|
|
|
|
|
|
2024-02-23 11:45:44 +00:00
|
|
|
error[E0046]: not all trait items implemented, missing: `foo`
|
2025-06-25 09:47:48 +02:00
|
|
|
--> $DIR/invalid-attribute.rs:84:1
|
2024-02-23 11:45:44 +00:00
|
|
|
|
|
|
|
|
|
LL | impl Quux for u8 {}
|
|
|
|
|
| ^^^^^^^^^^^^^^^^ missing `foo` in implementation
|
|
|
|
|
...
|
|
|
|
|
LL | fn foo();
|
|
|
|
|
| --------- `foo` from trait
|
|
|
|
|
|
2023-09-23 22:51:43 -04:00
|
|
|
error: `#[target_feature(..)]` cannot be applied to safe trait method
|
2025-06-25 09:47:48 +02:00
|
|
|
--> $DIR/invalid-attribute.rs:100:5
|
2020-04-16 17:11:05 +02:00
|
|
|
|
|
|
|
|
|
LL | #[target_feature(enable = "sse2")]
|
2023-09-23 22:51:43 -04:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be applied to safe trait method
|
2020-04-16 17:11:05 +02:00
|
|
|
...
|
|
|
|
|
LL | fn foo() {}
|
2020-08-12 17:02:14 -04:00
|
|
|
| -------- not an `unsafe` function
|
2020-04-16 17:11:05 +02:00
|
|
|
|
2024-12-16 10:25:11 +00:00
|
|
|
error[E0053]: method `foo` has an incompatible type for trait
|
2025-06-25 09:47:48 +02:00
|
|
|
--> $DIR/invalid-attribute.rs:103:5
|
2024-12-16 10:25:11 +00:00
|
|
|
|
|
|
|
|
|
LL | fn foo() {}
|
|
|
|
|
| ^^^^^^^^ expected safe fn, found unsafe fn
|
|
|
|
|
|
|
|
|
|
|
note: type in trait
|
2025-06-25 09:47:48 +02:00
|
|
|
--> $DIR/invalid-attribute.rs:95:5
|
2024-12-16 10:25:11 +00:00
|
|
|
|
|
|
|
|
|
LL | fn foo();
|
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
= note: expected signature `fn()`
|
|
|
|
|
found signature `#[target_features] fn()`
|
|
|
|
|
|
2025-06-25 09:47:48 +02:00
|
|
|
error: the feature named `+sse2` is not valid for this target
|
|
|
|
|
--> $DIR/invalid-attribute.rs:124:18
|
|
|
|
|
|
|
|
|
|
|
LL | #[target_feature(enable = "+sse2")]
|
|
|
|
|
| ^^^^^^^^^^^^^^^^ `+sse2` is not valid for this target
|
|
|
|
|
|
|
|
|
|
|
= help: consider removing the leading `+` in the feature name
|
|
|
|
|
|
|
|
|
|
error: aborting due to 24 previous errors
|
2019-09-26 11:00:53 +01:00
|
|
|
|
2025-06-25 09:47:48 +02:00
|
|
|
Some errors have detailed explanations: E0046, E0053, E0539.
|
2023-10-31 13:45:26 +00:00
|
|
|
For more information about an error, try `rustc --explain E0046`.
|