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