1 error: asm with the `pure` option must have at least one output
2 --> $DIR/naked-functions.rs:111:14
4 LL | asm!("", options(readonly, nostack), options(pure));
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^
7 error: this is a user specified error
8 --> $DIR/naked-functions.rs:203:5
10 LL | compile_error!("this is a user specified error")
11 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13 error: this is a user specified error
14 --> $DIR/naked-functions.rs:209:5
16 LL | compile_error!("this is a user specified error");
17 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19 error: asm template must be a string literal
20 --> $DIR/naked-functions.rs:216:10
22 LL | asm!(invalid_syntax)
25 error: patterns not allowed in naked function parameters
26 --> $DIR/naked-functions.rs:20:5
31 error: patterns not allowed in naked function parameters
32 --> $DIR/naked-functions.rs:22:5
37 error: patterns not allowed in naked function parameters
38 --> $DIR/naked-functions.rs:24:6
40 LL | (None | Some(_)): Option<std::ptr::NonNull<u8>>,
43 error: patterns not allowed in naked function parameters
44 --> $DIR/naked-functions.rs:26:5
49 error: referencing function parameters is not allowed in naked functions
50 --> $DIR/naked-functions.rs:35:5
55 = help: follow the calling convention in asm block to use parameters
57 error[E0787]: naked functions must contain a single asm block
58 --> $DIR/naked-functions.rs:33:1
60 LL | pub unsafe extern "C" fn inc(a: u32) -> u32 {
61 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
64 | ----- non-asm is unsupported in naked functions
66 error: referencing function parameters is not allowed in naked functions
67 --> $DIR/naked-functions.rs:42:31
69 LL | asm!("/* {0} */", in(reg) a, options(noreturn));
72 = help: follow the calling convention in asm block to use parameters
74 error[E0787]: only `const` and `sym` operands are supported in naked functions
75 --> $DIR/naked-functions.rs:42:23
77 LL | asm!("/* {0} */", in(reg) a, options(noreturn));
80 error[E0787]: naked functions must contain a single asm block
81 --> $DIR/naked-functions.rs:48:1
83 LL | pub unsafe extern "C" fn inc_closure(a: u32) -> u32 {
84 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
87 | ------------ non-asm is unsupported in naked functions
89 error[E0787]: only `const` and `sym` operands are supported in naked functions
90 --> $DIR/naked-functions.rs:65:10
95 LL | inlateout(reg) b,
104 error[E0787]: asm in naked functions must use `noreturn` option
105 --> $DIR/naked-functions.rs:63:5
107 LL | / asm!("/* {0} {1} {2} {3} {4} {5} {6} */",
116 help: consider specifying that the asm block is responsible for returning from the function
118 LL | sym G, options(noreturn),
119 | +++++++++++++++++++
121 error[E0787]: naked functions must contain a single asm block
122 --> $DIR/naked-functions.rs:54:1
124 LL | pub unsafe extern "C" fn unsupported_operands() {
125 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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
138 error[E0787]: naked functions must contain a single asm block
139 --> $DIR/naked-functions.rs:77:1
141 LL | pub extern "C" fn missing_assembly() {
142 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
144 error[E0787]: asm in naked functions must use `noreturn` option
145 --> $DIR/naked-functions.rs:84:5
150 help: consider specifying that the asm block is responsible for returning from the function
152 LL | asm!("", options(noreturn));
153 | +++++++++++++++++++
155 error[E0787]: asm in naked functions must use `noreturn` option
156 --> $DIR/naked-functions.rs:86:5
161 help: consider specifying that the asm block is responsible for returning from the function
163 LL | asm!("", options(noreturn));
164 | +++++++++++++++++++
166 error[E0787]: asm in naked functions must use `noreturn` option
167 --> $DIR/naked-functions.rs:88:5
172 help: consider specifying that the asm block is responsible for returning from the function
174 LL | asm!("", options(noreturn));
175 | +++++++++++++++++++
177 error[E0787]: naked functions must contain a single asm block
178 --> $DIR/naked-functions.rs:82:1
180 LL | pub extern "C" fn too_many_asm_blocks() {
181 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
184 | -------- multiple asm blocks are unsupported in naked functions
187 | -------- multiple asm blocks are unsupported in naked functions
189 LL | asm!("", options(noreturn));
190 | --------------------------- multiple asm blocks are unsupported in naked functions
192 error: referencing function parameters is not allowed in naked functions
193 --> $DIR/naked-functions.rs:97:11
198 = help: follow the calling convention in asm block to use parameters
200 error[E0787]: naked functions must contain a single asm block
201 --> $DIR/naked-functions.rs:95:5
203 LL | pub extern "C" fn inner(y: usize) -> usize {
204 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
207 | --- non-asm is unsupported in naked functions
209 error[E0787]: asm options unsupported in naked functions: `nomem`, `preserves_flags`
210 --> $DIR/naked-functions.rs:105:5
212 LL | asm!("", options(nomem, preserves_flags, noreturn));
213 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
215 error[E0787]: asm options unsupported in naked functions: `nostack`, `pure`, `readonly`
216 --> $DIR/naked-functions.rs:111:5
218 LL | asm!("", options(readonly, nostack), options(pure));
219 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
221 error[E0787]: asm in naked functions must use `noreturn` option
222 --> $DIR/naked-functions.rs:111:5
224 LL | asm!("", options(readonly, nostack), options(pure));
225 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
227 help: consider specifying that the asm block is responsible for returning from the function
229 LL | asm!("", options(noreturn), options(readonly, nostack), options(pure));
230 | +++++++++++++++++++
232 error[E0787]: asm options unsupported in naked functions: `may_unwind`
233 --> $DIR/naked-functions.rs:119:5
235 LL | asm!("", options(noreturn, may_unwind));
236 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
238 warning: Rust ABI is unsupported in naked functions
239 --> $DIR/naked-functions.rs:124:1
241 LL | pub unsafe fn default_abi() {
242 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
244 = note: `#[warn(undefined_naked_function_abi)]` on by default
246 warning: Rust ABI is unsupported in naked functions
247 --> $DIR/naked-functions.rs:130:1
249 LL | pub unsafe fn rust_abi() {
250 | ^^^^^^^^^^^^^^^^^^^^^^^^
252 error: naked functions cannot be inlined
253 --> $DIR/naked-functions.rs:170:1
258 error: naked functions cannot be inlined
259 --> $DIR/naked-functions.rs:177:1
261 LL | #[inline(always)]
264 error: naked functions cannot be inlined
265 --> $DIR/naked-functions.rs:184:1
267 LL | #[inline(never)]
270 error: naked functions cannot be inlined
271 --> $DIR/naked-functions.rs:191:1
276 error: naked functions cannot be inlined
277 --> $DIR/naked-functions.rs:193:1
279 LL | #[inline(always)]
282 error: naked functions cannot be inlined
283 --> $DIR/naked-functions.rs:195:1
285 LL | #[inline(never)]
288 error: aborting due to 33 previous errors; 2 warnings emitted
290 For more information about this error, try `rustc --explain E0787`.