@@ -57,13 +57,11 @@ LL | a + 1
57
57
error[E0787]: naked functions must contain a single asm block
58
58
--> $DIR/naked-functions.rs:33:1
59
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
- | |_^
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
67
65
68
66
error: referencing function parameters is not allowed in naked functions
69
67
--> $DIR/naked-functions.rs:42:31
@@ -82,12 +80,11 @@ LL | asm!("/* {0} */", in(reg) a, options(noreturn));
82
80
error[E0787]: naked functions must contain a single asm block
83
81
--> $DIR/naked-functions.rs:48:1
84
82
|
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
- | |_^
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
91
88
92
89
error[E0787]: only `const` and `sym` operands are supported in naked functions
93
90
--> $DIR/naked-functions.rs:65:10
@@ -124,30 +121,25 @@ LL | sym G, options(noreturn),
124
121
error[E0787]: naked functions must contain a single asm block
125
122
--> $DIR/naked-functions.rs:54:1
126
123
|
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
- | |_^
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
143
137
144
138
error[E0787]: naked functions must contain a single asm block
145
139
--> $DIR/naked-functions.rs:77:1
146
140
|
147
- LL | / pub extern "C" fn missing_assembly() {
148
- LL | |
149
- LL | | }
150
- | |_^
141
+ LL | pub extern "C" fn missing_assembly() {
142
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
151
143
152
144
error[E0787]: asm in naked functions must use `noreturn` option
153
145
--> $DIR/naked-functions.rs:84:5
@@ -185,20 +177,17 @@ LL | asm!("", options(noreturn));
185
177
error[E0787]: naked functions must contain a single asm block
186
178
--> $DIR/naked-functions.rs:82:1
187
179
|
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
- | |_^
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
202
191
203
192
error: referencing function parameters is not allowed in naked functions
204
193
--> $DIR/naked-functions.rs:97:11
@@ -211,13 +200,11 @@ LL | *&y
211
200
error[E0787]: naked functions must contain a single asm block
212
201
--> $DIR/naked-functions.rs:95:5
213
202
|
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
- | |_____^
203
+ LL | pub extern "C" fn inner(y: usize) -> usize {
204
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
205
+ LL |
206
+ LL | *&y
207
+ | --- non-asm is unsupported in naked functions
221
208
222
209
error[E0787]: asm options unsupported in naked functions: `nomem`, `preserves_flags`
223
210
--> $DIR/naked-functions.rs:105:5
@@ -249,18 +236,18 @@ LL | asm!("", options(noreturn, may_unwind));
249
236
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
250
237
251
238
warning: Rust ABI is unsupported in naked functions
252
- --> $DIR/naked-functions.rs:124:15
239
+ --> $DIR/naked-functions.rs:124:1
253
240
|
254
241
LL | pub unsafe fn default_abi() {
255
- | ^^^^^^^^^^^
242
+ | ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^
256
243
|
257
244
= note: `#[warn(undefined_naked_function_abi)]` on by default
258
245
259
246
warning: Rust ABI is unsupported in naked functions
260
- --> $DIR/naked-functions.rs:130:15
247
+ --> $DIR/naked-functions.rs:130:1
261
248
|
262
249
LL | pub unsafe fn rust_abi() {
263
- | ^^^^^^^^
250
+ | ^^^^^^^^^^^^^^^^ ^^^^^^^^
264
251
265
252
error: naked functions cannot be inlined
266
253
--> $DIR/naked-functions.rs:170:1
0 commit comments