@@ -57,13 +57,11 @@ LL | a + 1
5757error[E0787]: naked functions must contain a single asm block
5858 --> $DIR/naked-functions.rs:33:1
5959 |
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
6765
6866error: referencing function parameters is not allowed in naked functions
6967 --> $DIR/naked-functions.rs:42:31
@@ -82,12 +80,11 @@ LL | asm!("/* {0} */", in(reg) a, options(noreturn));
8280error[E0787]: naked functions must contain a single asm block
8381 --> $DIR/naked-functions.rs:48:1
8482 |
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
9188
9289error[E0787]: only `const` and `sym` operands are supported in naked functions
9390 --> $DIR/naked-functions.rs:65:10
@@ -124,30 +121,25 @@ LL | sym G, options(noreturn),
124121error[E0787]: naked functions must contain a single asm block
125122 --> $DIR/naked-functions.rs:54:1
126123 |
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
143137
144138error[E0787]: naked functions must contain a single asm block
145139 --> $DIR/naked-functions.rs:77:1
146140 |
147- LL | / pub extern "C" fn missing_assembly() {
148- LL | |
149- LL | | }
150- | |_^
141+ LL | pub extern "C" fn missing_assembly() {
142+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
151143
152144error[E0787]: asm in naked functions must use `noreturn` option
153145 --> $DIR/naked-functions.rs:84:5
@@ -185,20 +177,17 @@ LL | asm!("", options(noreturn));
185177error[E0787]: naked functions must contain a single asm block
186178 --> $DIR/naked-functions.rs:82:1
187179 |
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
202191
203192error: referencing function parameters is not allowed in naked functions
204193 --> $DIR/naked-functions.rs:97:11
@@ -211,13 +200,11 @@ LL | *&y
211200error[E0787]: naked functions must contain a single asm block
212201 --> $DIR/naked-functions.rs:95:5
213202 |
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
221208
222209error[E0787]: asm options unsupported in naked functions: `nomem`, `preserves_flags`
223210 --> $DIR/naked-functions.rs:105:5
@@ -249,18 +236,18 @@ LL | asm!("", options(noreturn, may_unwind));
249236 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
250237
251238warning: Rust ABI is unsupported in naked functions
252- --> $DIR/naked-functions.rs:124:15
239+ --> $DIR/naked-functions.rs:124:1
253240 |
254241LL | pub unsafe fn default_abi() {
255- | ^^^^^^^^^^^
242+ | ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^
256243 |
257244 = note: `#[warn(undefined_naked_function_abi)]` on by default
258245
259246warning: Rust ABI is unsupported in naked functions
260- --> $DIR/naked-functions.rs:130:15
247+ --> $DIR/naked-functions.rs:130:1
261248 |
262249LL | pub unsafe fn rust_abi() {
263- | ^^^^^^^^
250+ | ^^^^^^^^^^^^^^^^ ^^^^^^^^
264251
265252error: naked functions cannot be inlined
266253 --> $DIR/naked-functions.rs:170:1
0 commit comments