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