]> git.lizzy.rs Git - rust.git/blob - tests/ui/target-feature/invalid-attribute.stderr
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / target-feature / invalid-attribute.stderr
1 error: malformed `target_feature` attribute input
2   --> $DIR/invalid-attribute.rs:17:1
3    |
4 LL | #[target_feature = "+sse2"]
5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[target_feature(enable = "name")]`
6
7 error: attribute should be applied to a function definition
8   --> $DIR/invalid-attribute.rs:34:1
9    |
10 LL | #[target_feature(enable = "sse2")]
11    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 LL |
13 LL | mod another {}
14    | -------------- not a function definition
15
16 error: attribute should be applied to a function definition
17   --> $DIR/invalid-attribute.rs:39:1
18    |
19 LL | #[target_feature(enable = "sse2")]
20    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21 LL |
22 LL | const FOO: usize = 7;
23    | --------------------- not a function definition
24
25 error: attribute should be applied to a function definition
26   --> $DIR/invalid-attribute.rs:44:1
27    |
28 LL | #[target_feature(enable = "sse2")]
29    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30 LL |
31 LL | struct Foo;
32    | ----------- not a function definition
33
34 error: attribute should be applied to a function definition
35   --> $DIR/invalid-attribute.rs:49:1
36    |
37 LL | #[target_feature(enable = "sse2")]
38    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39 LL |
40 LL | enum Bar {}
41    | ----------- not a function definition
42
43 error: attribute should be applied to a function definition
44   --> $DIR/invalid-attribute.rs:54:1
45    |
46 LL |   #[target_feature(enable = "sse2")]
47    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48 LL |
49 LL | / union Qux {
50 LL | |
51 LL | |     f1: u16,
52 LL | |     f2: u16,
53 LL | | }
54    | |_- not a function definition
55
56 error: attribute should be applied to a function definition
57   --> $DIR/invalid-attribute.rs:62:1
58    |
59 LL | #[target_feature(enable = "sse2")]
60    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61 LL |
62 LL | trait Baz {}
63    | ------------ not a function definition
64
65 error: attribute should be applied to a function definition
66   --> $DIR/invalid-attribute.rs:85:5
67    |
68 LL |       #[target_feature(enable = "sse2")]
69    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
70 LL |
71 LL | /     unsafe {
72 LL | |         foo();
73 LL | |         bar();
74 LL | |     }
75    | |_____- not a function definition
76
77 error: attribute should be applied to a function definition
78   --> $DIR/invalid-attribute.rs:93:5
79    |
80 LL |     #[target_feature(enable = "sse2")]
81    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
82 LL |
83 LL |     || {};
84    |     ----- not a function definition
85
86 error: the feature named `foo` is not valid for this target
87   --> $DIR/invalid-attribute.rs:19:18
88    |
89 LL | #[target_feature(enable = "foo")]
90    |                  ^^^^^^^^^^^^^^ `foo` is not valid for this target
91
92 error: malformed `target_feature` attribute input
93   --> $DIR/invalid-attribute.rs:22:18
94    |
95 LL | #[target_feature(bar)]
96    |                  ^^^ help: must be of the form: `enable = ".."`
97
98 error: malformed `target_feature` attribute input
99   --> $DIR/invalid-attribute.rs:24:18
100    |
101 LL | #[target_feature(disable = "baz")]
102    |                  ^^^^^^^^^^^^^^^ help: must be of the form: `enable = ".."`
103
104 error[E0658]: `#[target_feature(..)]` can only be applied to `unsafe` functions
105   --> $DIR/invalid-attribute.rs:28:1
106    |
107 LL | #[target_feature(enable = "sse2")]
108    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
109 ...
110 LL | fn bar() {}
111    | -------- not an `unsafe` function
112    |
113    = note: see issue #69098 <https://github.com/rust-lang/rust/issues/69098> for more information
114    = help: add `#![feature(target_feature_11)]` to the crate attributes to enable
115
116 error: cannot use `#[inline(always)]` with `#[target_feature]`
117   --> $DIR/invalid-attribute.rs:67:1
118    |
119 LL | #[inline(always)]
120    | ^^^^^^^^^^^^^^^^^
121
122 error[E0658]: `#[target_feature(..)]` can only be applied to `unsafe` functions
123   --> $DIR/invalid-attribute.rs:77:5
124    |
125 LL |     #[target_feature(enable = "sse2")]
126    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
127 ...
128 LL |     fn foo() {}
129    |     -------- not an `unsafe` function
130    |
131    = note: see issue #69098 <https://github.com/rust-lang/rust/issues/69098> for more information
132    = help: add `#![feature(target_feature_11)]` to the crate attributes to enable
133
134 error: aborting due to 15 previous errors
135
136 For more information about this error, try `rustc --explain E0658`.