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