]> git.lizzy.rs Git - rust.git/blob - src/test/ui/asm/naked-functions.stderr
Rollup merge of #99110 - audunhalland:match_has_guard_from_candidate, r=pnkfelix
[rust.git] / src / test / ui / asm / naked-functions.stderr
1 error: asm with the `pure` option must have at least one output
2   --> $DIR/naked-functions.rs:111:14
3    |
4 LL |     asm!("", options(readonly, nostack), options(pure));
5    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^
6
7 error: this is a user specified error
8   --> $DIR/naked-functions.rs:203:5
9    |
10 LL |     compile_error!("this is a user specified error")
11    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12
13 error: this is a user specified error
14   --> $DIR/naked-functions.rs:209:5
15    |
16 LL |     compile_error!("this is a user specified error");
17    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18
19 error: asm template must be a string literal
20   --> $DIR/naked-functions.rs:216:10
21    |
22 LL |     asm!(invalid_syntax)
23    |          ^^^^^^^^^^^^^^
24
25 error: patterns not allowed in naked function parameters
26   --> $DIR/naked-functions.rs:20:5
27    |
28 LL |     mut a: u32,
29    |     ^^^^^
30
31 error: patterns not allowed in naked function parameters
32   --> $DIR/naked-functions.rs:22:5
33    |
34 LL |     &b: &i32,
35    |     ^^
36
37 error: patterns not allowed in naked function parameters
38   --> $DIR/naked-functions.rs:24:6
39    |
40 LL |     (None | Some(_)): Option<std::ptr::NonNull<u8>>,
41    |      ^^^^^^^^^^^^^^
42
43 error: patterns not allowed in naked function parameters
44   --> $DIR/naked-functions.rs:26:5
45    |
46 LL |     P { x, y }: P,
47    |     ^^^^^^^^^^
48
49 error: referencing function parameters is not allowed in naked functions
50   --> $DIR/naked-functions.rs:35:5
51    |
52 LL |     a + 1
53    |     ^
54    |
55    = help: follow the calling convention in asm block to use parameters
56
57 error[E0787]: naked functions must contain a single asm block
58   --> $DIR/naked-functions.rs:33:1
59    |
60 LL | pub unsafe extern "C" fn inc(a: u32) -> u32 {
61    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
62 LL |
63 LL |     a + 1
64    |     ----- non-asm is unsupported in naked functions
65
66 error: referencing function parameters is not allowed in naked functions
67   --> $DIR/naked-functions.rs:42:31
68    |
69 LL |     asm!("/* {0} */", in(reg) a, options(noreturn));
70    |                               ^
71    |
72    = help: follow the calling convention in asm block to use parameters
73
74 error[E0787]: only `const` and `sym` operands are supported in naked functions
75   --> $DIR/naked-functions.rs:42:23
76    |
77 LL |     asm!("/* {0} */", in(reg) a, options(noreturn));
78    |                       ^^^^^^^^^
79
80 error[E0787]: naked functions must contain a single asm block
81   --> $DIR/naked-functions.rs:48:1
82    |
83 LL | pub unsafe extern "C" fn inc_closure(a: u32) -> u32 {
84    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
85 LL |
86 LL |     (|| a + 1)()
87    |     ------------ non-asm is unsupported in naked functions
88
89 error[E0787]: only `const` and `sym` operands are supported in naked functions
90   --> $DIR/naked-functions.rs:65:10
91    |
92 LL |          in(reg) a,
93    |          ^^^^^^^^^
94 LL |
95 LL |          inlateout(reg) b,
96    |          ^^^^^^^^^^^^^^^^
97 LL |          inout(reg) c,
98    |          ^^^^^^^^^^^^
99 LL |          lateout(reg) d,
100    |          ^^^^^^^^^^^^^^
101 LL |          out(reg) e,
102    |          ^^^^^^^^^^
103
104 error[E0787]: asm in naked functions must use `noreturn` option
105   --> $DIR/naked-functions.rs:63:5
106    |
107 LL | /     asm!("/* {0} {1} {2} {3} {4} {5} {6} */",
108 LL | |
109 LL | |          in(reg) a,
110 LL | |
111 ...  |
112 LL | |          sym G,
113 LL | |     );
114    | |_____^
115    |
116 help: consider specifying that the asm block is responsible for returning from the function
117    |
118 LL |          sym G, options(noreturn),
119    |               +++++++++++++++++++
120
121 error[E0787]: naked functions must contain a single asm block
122   --> $DIR/naked-functions.rs:54:1
123    |
124 LL | pub unsafe extern "C" fn unsupported_operands() {
125    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
126 LL |
127 LL |     let mut a = 0usize;
128    |     ------------------- non-asm is unsupported in naked functions
129 LL |     let mut b = 0usize;
130    |     ------------------- non-asm is unsupported in naked functions
131 LL |     let mut c = 0usize;
132    |     ------------------- non-asm is unsupported in naked functions
133 LL |     let mut d = 0usize;
134    |     ------------------- non-asm is unsupported in naked functions
135 LL |     let mut e = 0usize;
136    |     ------------------- non-asm is unsupported in naked functions
137
138 error[E0787]: naked functions must contain a single asm block
139   --> $DIR/naked-functions.rs:77:1
140    |
141 LL | pub extern "C" fn missing_assembly() {
142    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
143
144 error[E0787]: asm in naked functions must use `noreturn` option
145   --> $DIR/naked-functions.rs:84:5
146    |
147 LL |     asm!("");
148    |     ^^^^^^^^
149    |
150 help: consider specifying that the asm block is responsible for returning from the function
151    |
152 LL |     asm!("", options(noreturn));
153    |            +++++++++++++++++++
154
155 error[E0787]: asm in naked functions must use `noreturn` option
156   --> $DIR/naked-functions.rs:86:5
157    |
158 LL |     asm!("");
159    |     ^^^^^^^^
160    |
161 help: consider specifying that the asm block is responsible for returning from the function
162    |
163 LL |     asm!("", options(noreturn));
164    |            +++++++++++++++++++
165
166 error[E0787]: asm in naked functions must use `noreturn` option
167   --> $DIR/naked-functions.rs:88:5
168    |
169 LL |     asm!("");
170    |     ^^^^^^^^
171    |
172 help: consider specifying that the asm block is responsible for returning from the function
173    |
174 LL |     asm!("", options(noreturn));
175    |            +++++++++++++++++++
176
177 error[E0787]: naked functions must contain a single asm block
178   --> $DIR/naked-functions.rs:82:1
179    |
180 LL | pub extern "C" fn too_many_asm_blocks() {
181    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
182 ...
183 LL |     asm!("");
184    |     -------- multiple asm blocks are unsupported in naked functions
185 LL |
186 LL |     asm!("");
187    |     -------- multiple asm blocks are unsupported in naked functions
188 LL |
189 LL |     asm!("", options(noreturn));
190    |     --------------------------- multiple asm blocks are unsupported in naked functions
191
192 error: referencing function parameters is not allowed in naked functions
193   --> $DIR/naked-functions.rs:97:11
194    |
195 LL |         *&y
196    |           ^
197    |
198    = help: follow the calling convention in asm block to use parameters
199
200 error[E0787]: naked functions must contain a single asm block
201   --> $DIR/naked-functions.rs:95:5
202    |
203 LL |     pub extern "C" fn inner(y: usize) -> usize {
204    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
205 LL |
206 LL |         *&y
207    |         --- non-asm is unsupported in naked functions
208
209 error[E0787]: asm options unsupported in naked functions: `nomem`, `preserves_flags`
210   --> $DIR/naked-functions.rs:105:5
211    |
212 LL |     asm!("", options(nomem, preserves_flags, noreturn));
213    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
214
215 error[E0787]: asm options unsupported in naked functions: `nostack`, `pure`, `readonly`
216   --> $DIR/naked-functions.rs:111:5
217    |
218 LL |     asm!("", options(readonly, nostack), options(pure));
219    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
220
221 error[E0787]: asm in naked functions must use `noreturn` option
222   --> $DIR/naked-functions.rs:111:5
223    |
224 LL |     asm!("", options(readonly, nostack), options(pure));
225    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
226    |
227 help: consider specifying that the asm block is responsible for returning from the function
228    |
229 LL |     asm!("", options(noreturn), options(readonly, nostack), options(pure));
230    |            +++++++++++++++++++
231
232 error[E0787]: asm options unsupported in naked functions: `may_unwind`
233   --> $DIR/naked-functions.rs:119:5
234    |
235 LL |     asm!("", options(noreturn, may_unwind));
236    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
237
238 warning: Rust ABI is unsupported in naked functions
239   --> $DIR/naked-functions.rs:124:1
240    |
241 LL | pub unsafe fn default_abi() {
242    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
243    |
244    = note: `#[warn(undefined_naked_function_abi)]` on by default
245
246 warning: Rust ABI is unsupported in naked functions
247   --> $DIR/naked-functions.rs:130:1
248    |
249 LL | pub unsafe fn rust_abi() {
250    | ^^^^^^^^^^^^^^^^^^^^^^^^
251
252 error: naked functions cannot be inlined
253   --> $DIR/naked-functions.rs:170:1
254    |
255 LL | #[inline]
256    | ^^^^^^^^^
257
258 error: naked functions cannot be inlined
259   --> $DIR/naked-functions.rs:177:1
260    |
261 LL | #[inline(always)]
262    | ^^^^^^^^^^^^^^^^^
263
264 error: naked functions cannot be inlined
265   --> $DIR/naked-functions.rs:184:1
266    |
267 LL | #[inline(never)]
268    | ^^^^^^^^^^^^^^^^
269
270 error: naked functions cannot be inlined
271   --> $DIR/naked-functions.rs:191:1
272    |
273 LL | #[inline]
274    | ^^^^^^^^^
275
276 error: naked functions cannot be inlined
277   --> $DIR/naked-functions.rs:193:1
278    |
279 LL | #[inline(always)]
280    | ^^^^^^^^^^^^^^^^^
281
282 error: naked functions cannot be inlined
283   --> $DIR/naked-functions.rs:195:1
284    |
285 LL | #[inline(never)]
286    | ^^^^^^^^^^^^^^^^
287
288 error: aborting due to 33 previous errors; 2 warnings emitted
289
290 For more information about this error, try `rustc --explain E0787`.