Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 27213b0

Browse files
committedSep 24, 2021
Disable some tests for platforms without registers.
Update new tests to run on aarch64 platforms.
1 parent 6d218d0 commit 27213b0

17 files changed

+296
-188
lines changed
 

‎src/test/ui/asm/aarch64/parse-error.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ fn main() {
7676
//~^ ERROR asm template must be a string literal
7777
asm!("{1}", format!("{{{}}}", 0), in(reg) foo, out(reg) bar);
7878
//~^ ERROR asm template must be a string literal
79+
asm!("{}", in(reg) _);
80+
//~^ ERROR _ cannot be used for input operands
81+
asm!("{}", inout(reg) _);
82+
//~^ ERROR _ cannot be used for input operands
83+
asm!("{}", inlateout(reg) _);
84+
//~^ ERROR _ cannot be used for input operands
7985
}
8086
}
8187

‎src/test/ui/asm/aarch64/parse-error.stderr

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -214,162 +214,180 @@ LL | asm!("{1}", format!("{{{}}}", 0), in(reg) foo, out(reg) bar);
214214
|
215215
= note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
216216

217+
error: _ cannot be used for input operands
218+
--> $DIR/parse-error.rs:79:28
219+
|
220+
LL | asm!("{}", in(reg) _);
221+
| ^
222+
223+
error: _ cannot be used for input operands
224+
--> $DIR/parse-error.rs:81:31
225+
|
226+
LL | asm!("{}", inout(reg) _);
227+
| ^
228+
229+
error: _ cannot be used for input operands
230+
--> $DIR/parse-error.rs:83:35
231+
|
232+
LL | asm!("{}", inlateout(reg) _);
233+
| ^
234+
217235
error: requires at least a template string argument
218-
--> $DIR/parse-error.rs:84:1
236+
--> $DIR/parse-error.rs:90:1
219237
|
220238
LL | global_asm!();
221239
| ^^^^^^^^^^^^^^
222240

223241
error: asm template must be a string literal
224-
--> $DIR/parse-error.rs:86:13
242+
--> $DIR/parse-error.rs:92:13
225243
|
226244
LL | global_asm!(FOO);
227245
| ^^^
228246

229247
error: expected token: `,`
230-
--> $DIR/parse-error.rs:88:18
248+
--> $DIR/parse-error.rs:94:18
231249
|
232250
LL | global_asm!("{}" FOO);
233251
| ^^^ expected `,`
234252

235253
error: expected operand, options, or additional template string
236-
--> $DIR/parse-error.rs:90:19
254+
--> $DIR/parse-error.rs:96:19
237255
|
238256
LL | global_asm!("{}", FOO);
239257
| ^^^ expected operand, options, or additional template string
240258

241259
error: expected expression, found end of macro arguments
242-
--> $DIR/parse-error.rs:92:24
260+
--> $DIR/parse-error.rs:98:24
243261
|
244262
LL | global_asm!("{}", const);
245263
| ^ expected expression
246264

247265
error: expected one of `,`, `.`, `?`, or an operator, found `FOO`
248-
--> $DIR/parse-error.rs:94:30
266+
--> $DIR/parse-error.rs:100:30
249267
|
250268
LL | global_asm!("{}", const(reg) FOO);
251269
| ^^^ expected one of `,`, `.`, `?`, or an operator
252270

253271
error: expected one of `)`, `att_syntax`, or `raw`, found `FOO`
254-
--> $DIR/parse-error.rs:96:25
272+
--> $DIR/parse-error.rs:102:25
255273
|
256274
LL | global_asm!("", options(FOO));
257275
| ^^^ expected one of `)`, `att_syntax`, or `raw`
258276

259277
error: expected one of `)`, `att_syntax`, or `raw`, found `nomem`
260-
--> $DIR/parse-error.rs:98:25
278+
--> $DIR/parse-error.rs:104:25
261279
|
262280
LL | global_asm!("", options(nomem FOO));
263281
| ^^^^^ expected one of `)`, `att_syntax`, or `raw`
264282

265283
error: expected one of `)`, `att_syntax`, or `raw`, found `nomem`
266-
--> $DIR/parse-error.rs:100:25
284+
--> $DIR/parse-error.rs:106:25
267285
|
268286
LL | global_asm!("", options(nomem, FOO));
269287
| ^^^^^ expected one of `)`, `att_syntax`, or `raw`
270288

271289
error: arguments are not allowed after options
272-
--> $DIR/parse-error.rs:102:30
290+
--> $DIR/parse-error.rs:108:30
273291
|
274292
LL | global_asm!("{}", options(), const FOO);
275293
| --------- ^^^^^^^^^ argument
276294
| |
277295
| previous options
278296

279297
error: expected string literal
280-
--> $DIR/parse-error.rs:104:29
298+
--> $DIR/parse-error.rs:110:29
281299
|
282300
LL | global_asm!("", clobber_abi(FOO));
283301
| ^^^ not a string literal
284302

285303
error: expected `)`, found `FOO`
286-
--> $DIR/parse-error.rs:106:33
304+
--> $DIR/parse-error.rs:112:33
287305
|
288306
LL | global_asm!("", clobber_abi("C" FOO));
289307
| ^^^ expected `)`
290308

291309
error: expected `)`, found `,`
292-
--> $DIR/parse-error.rs:108:32
310+
--> $DIR/parse-error.rs:114:32
293311
|
294312
LL | global_asm!("", clobber_abi("C", FOO));
295313
| ^ expected `)`
296314

297315
error: arguments are not allowed after clobber_abi
298-
--> $DIR/parse-error.rs:110:37
316+
--> $DIR/parse-error.rs:116:37
299317
|
300318
LL | global_asm!("{}", clobber_abi("C"), const FOO);
301319
| ---------------- ^^^^^^^^^ argument
302320
| |
303321
| clobber_abi
304322

305323
error: `clobber_abi` cannot be used with `global_asm!`
306-
--> $DIR/parse-error.rs:110:19
324+
--> $DIR/parse-error.rs:116:19
307325
|
308326
LL | global_asm!("{}", clobber_abi("C"), const FOO);
309327
| ^^^^^^^^^^^^^^^^
310328

311329
error: clobber_abi is not allowed after options
312-
--> $DIR/parse-error.rs:113:28
330+
--> $DIR/parse-error.rs:119:28
313331
|
314332
LL | global_asm!("", options(), clobber_abi("C"));
315333
| --------- ^^^^^^^^^^^^^^^^
316334
| |
317335
| options
318336

319337
error: clobber_abi is not allowed after options
320-
--> $DIR/parse-error.rs:115:30
338+
--> $DIR/parse-error.rs:121:30
321339
|
322340
LL | global_asm!("{}", options(), clobber_abi("C"), const FOO);
323341
| --------- ^^^^^^^^^^^^^^^^
324342
| |
325343
| options
326344

327345
error: clobber_abi specified multiple times
328-
--> $DIR/parse-error.rs:117:35
346+
--> $DIR/parse-error.rs:123:35
329347
|
330348
LL | global_asm!("", clobber_abi("C"), clobber_abi("C"));
331349
| ---------------- ^^^^^^^^^^^^^^^^
332350
| |
333351
| clobber_abi previously specified here
334352

335353
error: duplicate argument named `a`
336-
--> $DIR/parse-error.rs:119:35
354+
--> $DIR/parse-error.rs:125:35
337355
|
338356
LL | global_asm!("{a}", a = const FOO, a = const BAR);
339357
| ------------- ^^^^^^^^^^^^^ duplicate argument
340358
| |
341359
| previously here
342360

343361
error: argument never used
344-
--> $DIR/parse-error.rs:119:35
362+
--> $DIR/parse-error.rs:125:35
345363
|
346364
LL | global_asm!("{a}", a = const FOO, a = const BAR);
347365
| ^^^^^^^^^^^^^ argument never used
348366
|
349367
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {1} */"`
350368

351369
error: expected one of `clobber_abi`, `const`, or `options`, found `""`
352-
--> $DIR/parse-error.rs:122:28
370+
--> $DIR/parse-error.rs:128:28
353371
|
354372
LL | global_asm!("", options(), "");
355373
| ^^ expected one of `clobber_abi`, `const`, or `options`
356374

357375
error: expected one of `clobber_abi`, `const`, or `options`, found `"{}"`
358-
--> $DIR/parse-error.rs:124:30
376+
--> $DIR/parse-error.rs:130:30
359377
|
360378
LL | global_asm!("{}", const FOO, "{}", const FOO);
361379
| ^^^^ expected one of `clobber_abi`, `const`, or `options`
362380

363381
error: asm template must be a string literal
364-
--> $DIR/parse-error.rs:126:13
382+
--> $DIR/parse-error.rs:132:13
365383
|
366384
LL | global_asm!(format!("{{{}}}", 0), const FOO);
367385
| ^^^^^^^^^^^^^^^^^^^^
368386
|
369387
= note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
370388

371389
error: asm template must be a string literal
372-
--> $DIR/parse-error.rs:128:20
390+
--> $DIR/parse-error.rs:134:20
373391
|
374392
LL | global_asm!("{1}", format!("{{{}}}", 0), const FOO, const BAR);
375393
| ^^^^^^^^^^^^^^^^^^^^
@@ -439,6 +457,6 @@ LL | let mut bar = 0;
439457
LL | asm!("{1}", in("x0") foo, const bar);
440458
| ^^^ non-constant value
441459

442-
error: aborting due to 63 previous errors
460+
error: aborting due to 66 previous errors
443461

444462
For more information about this error, try `rustc --explain E0435`.

‎src/test/ui/asm/issue-87802.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
// only-x86_64
1+
// needs-asm-support
2+
// ignore-nvptx64
3+
// ignore-spirv
4+
// ignore-wasm32
25
// Make sure rustc doesn't ICE on asm! when output type is !.
36

47
#![feature(asm)]

‎src/test/ui/asm/issue-87802.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: cannot use value of type `!` for inline assembly
2-
--> $DIR/issue-87802.rs:9:36
2+
--> $DIR/issue-87802.rs:12:36
33
|
44
LL | asm!("/* {0} */", out(reg) x);
55
| ^

‎src/test/ui/asm/naked-functions-ffi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// check-pass
2-
// only-x86_64
2+
// needs-asm-support
33
#![feature(asm)]
44
#![feature(naked_functions)]
55
#![crate_type = "lib"]
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
error: unused variable: `a`
2+
--> $DIR/naked-functions-unused.rs:15:32
3+
|
4+
LL | pub extern "C" fn function(a: usize, b: usize) -> usize {
5+
| ^ help: if this is intentional, prefix it with an underscore: `_a`
6+
|
7+
note: the lint level is defined here
8+
--> $DIR/naked-functions-unused.rs:4:9
9+
|
10+
LL | #![deny(unused)]
11+
| ^^^^^^
12+
= note: `#[deny(unused_variables)]` implied by `#[deny(unused)]`
13+
14+
error: unused variable: `b`
15+
--> $DIR/naked-functions-unused.rs:15:42
16+
|
17+
LL | pub extern "C" fn function(a: usize, b: usize) -> usize {
18+
| ^ help: if this is intentional, prefix it with an underscore: `_b`
19+
20+
error: unused variable: `a`
21+
--> $DIR/naked-functions-unused.rs:24:38
22+
|
23+
LL | pub extern "C" fn associated(a: usize, b: usize) -> usize {
24+
| ^ help: if this is intentional, prefix it with an underscore: `_a`
25+
26+
error: unused variable: `b`
27+
--> $DIR/naked-functions-unused.rs:24:48
28+
|
29+
LL | pub extern "C" fn associated(a: usize, b: usize) -> usize {
30+
| ^ help: if this is intentional, prefix it with an underscore: `_b`
31+
32+
error: unused variable: `a`
33+
--> $DIR/naked-functions-unused.rs:30:41
34+
|
35+
LL | pub extern "C" fn method(&self, a: usize, b: usize) -> usize {
36+
| ^ help: if this is intentional, prefix it with an underscore: `_a`
37+
38+
error: unused variable: `b`
39+
--> $DIR/naked-functions-unused.rs:30:51
40+
|
41+
LL | pub extern "C" fn method(&self, a: usize, b: usize) -> usize {
42+
| ^ help: if this is intentional, prefix it with an underscore: `_b`
43+
44+
error: unused variable: `a`
45+
--> $DIR/naked-functions-unused.rs:38:40
46+
|
47+
LL | extern "C" fn trait_associated(a: usize, b: usize) -> usize {
48+
| ^ help: if this is intentional, prefix it with an underscore: `_a`
49+
50+
error: unused variable: `b`
51+
--> $DIR/naked-functions-unused.rs:38:50
52+
|
53+
LL | extern "C" fn trait_associated(a: usize, b: usize) -> usize {
54+
| ^ help: if this is intentional, prefix it with an underscore: `_b`
55+
56+
error: unused variable: `a`
57+
--> $DIR/naked-functions-unused.rs:44:43
58+
|
59+
LL | extern "C" fn trait_method(&self, a: usize, b: usize) -> usize {
60+
| ^ help: if this is intentional, prefix it with an underscore: `_a`
61+
62+
error: unused variable: `b`
63+
--> $DIR/naked-functions-unused.rs:44:53
64+
|
65+
LL | extern "C" fn trait_method(&self, a: usize, b: usize) -> usize {
66+
| ^ help: if this is intentional, prefix it with an underscore: `_b`
67+
68+
error: aborting due to 10 previous errors
69+

‎src/test/ui/asm/naked-functions-unused.rs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
// only-x86_64
1+
// revisions: x86_64 aarch64
2+
//[x86_64] only-x86_64
3+
//[aarch64] only-aarch64
24
#![deny(unused)]
35
#![feature(asm)]
46
#![feature(naked_functions)]
57
#![crate_type = "lib"]
68

79
pub trait Trait {
8-
extern "sysv64" fn trait_associated(a: usize, b: usize) -> usize;
9-
extern "sysv64" fn trait_method(&self, a: usize, b: usize) -> usize;
10+
extern "C" fn trait_associated(a: usize, b: usize) -> usize;
11+
extern "C" fn trait_method(&self, a: usize, b: usize) -> usize;
1012
}
1113

1214
pub mod normal {
13-
pub extern "sysv64" fn function(a: usize, b: usize) -> usize {
15+
pub extern "C" fn function(a: usize, b: usize) -> usize {
1416
//~^ ERROR unused variable: `a`
1517
//~| ERROR unused variable: `b`
1618
unsafe { asm!("", options(noreturn)); }
@@ -19,27 +21,27 @@ pub mod normal {
1921
pub struct Normal;
2022

2123
impl Normal {
22-
pub extern "sysv64" fn associated(a: usize, b: usize) -> usize {
24+
pub extern "C" fn associated(a: usize, b: usize) -> usize {
2325
//~^ ERROR unused variable: `a`
2426
//~| ERROR unused variable: `b`
2527
unsafe { asm!("", options(noreturn)); }
2628
}
2729

28-
pub extern "sysv64" fn method(&self, a: usize, b: usize) -> usize {
30+
pub extern "C" fn method(&self, a: usize, b: usize) -> usize {
2931
//~^ ERROR unused variable: `a`
3032
//~| ERROR unused variable: `b`
3133
unsafe { asm!("", options(noreturn)); }
3234
}
3335
}
3436

3537
impl super::Trait for Normal {
36-
extern "sysv64" fn trait_associated(a: usize, b: usize) -> usize {
38+
extern "C" fn trait_associated(a: usize, b: usize) -> usize {
3739
//~^ ERROR unused variable: `a`
3840
//~| ERROR unused variable: `b`
3941
unsafe { asm!("", options(noreturn)); }
4042
}
4143

42-
extern "sysv64" fn trait_method(&self, a: usize, b: usize) -> usize {
44+
extern "C" fn trait_method(&self, a: usize, b: usize) -> usize {
4345
//~^ ERROR unused variable: `a`
4446
//~| ERROR unused variable: `b`
4547
unsafe { asm!("", options(noreturn)); }
@@ -49,32 +51,32 @@ pub mod normal {
4951

5052
pub mod naked {
5153
#[naked]
52-
pub extern "sysv64" fn function(a: usize, b: usize) -> usize {
54+
pub extern "C" fn function(a: usize, b: usize) -> usize {
5355
unsafe { asm!("", options(noreturn)); }
5456
}
5557

5658
pub struct Naked;
5759

5860
impl Naked {
5961
#[naked]
60-
pub extern "sysv64" fn associated(a: usize, b: usize) -> usize {
62+
pub extern "C" fn associated(a: usize, b: usize) -> usize {
6163
unsafe { asm!("", options(noreturn)); }
6264
}
6365

6466
#[naked]
65-
pub extern "sysv64" fn method(&self, a: usize, b: usize) -> usize {
67+
pub extern "C" fn method(&self, a: usize, b: usize) -> usize {
6668
unsafe { asm!("", options(noreturn)); }
6769
}
6870
}
6971

7072
impl super::Trait for Naked {
7173
#[naked]
72-
extern "sysv64" fn trait_associated(a: usize, b: usize) -> usize {
74+
extern "C" fn trait_associated(a: usize, b: usize) -> usize {
7375
unsafe { asm!("", options(noreturn)); }
7476
}
7577

7678
#[naked]
77-
extern "sysv64" fn trait_method(&self, a: usize, b: usize) -> usize {
79+
extern "C" fn trait_method(&self, a: usize, b: usize) -> usize {
7880
unsafe { asm!("", options(noreturn)); }
7981
}
8082
}

‎src/test/ui/asm/naked-functions-unused.stderr

Lines changed: 0 additions & 69 deletions
This file was deleted.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
error: unused variable: `a`
2+
--> $DIR/naked-functions-unused.rs:15:32
3+
|
4+
LL | pub extern "C" fn function(a: usize, b: usize) -> usize {
5+
| ^ help: if this is intentional, prefix it with an underscore: `_a`
6+
|
7+
note: the lint level is defined here
8+
--> $DIR/naked-functions-unused.rs:4:9
9+
|
10+
LL | #![deny(unused)]
11+
| ^^^^^^
12+
= note: `#[deny(unused_variables)]` implied by `#[deny(unused)]`
13+
14+
error: unused variable: `b`
15+
--> $DIR/naked-functions-unused.rs:15:42
16+
|
17+
LL | pub extern "C" fn function(a: usize, b: usize) -> usize {
18+
| ^ help: if this is intentional, prefix it with an underscore: `_b`
19+
20+
error: unused variable: `a`
21+
--> $DIR/naked-functions-unused.rs:24:38
22+
|
23+
LL | pub extern "C" fn associated(a: usize, b: usize) -> usize {
24+
| ^ help: if this is intentional, prefix it with an underscore: `_a`
25+
26+
error: unused variable: `b`
27+
--> $DIR/naked-functions-unused.rs:24:48
28+
|
29+
LL | pub extern "C" fn associated(a: usize, b: usize) -> usize {
30+
| ^ help: if this is intentional, prefix it with an underscore: `_b`
31+
32+
error: unused variable: `a`
33+
--> $DIR/naked-functions-unused.rs:30:41
34+
|
35+
LL | pub extern "C" fn method(&self, a: usize, b: usize) -> usize {
36+
| ^ help: if this is intentional, prefix it with an underscore: `_a`
37+
38+
error: unused variable: `b`
39+
--> $DIR/naked-functions-unused.rs:30:51
40+
|
41+
LL | pub extern "C" fn method(&self, a: usize, b: usize) -> usize {
42+
| ^ help: if this is intentional, prefix it with an underscore: `_b`
43+
44+
error: unused variable: `a`
45+
--> $DIR/naked-functions-unused.rs:38:40
46+
|
47+
LL | extern "C" fn trait_associated(a: usize, b: usize) -> usize {
48+
| ^ help: if this is intentional, prefix it with an underscore: `_a`
49+
50+
error: unused variable: `b`
51+
--> $DIR/naked-functions-unused.rs:38:50
52+
|
53+
LL | extern "C" fn trait_associated(a: usize, b: usize) -> usize {
54+
| ^ help: if this is intentional, prefix it with an underscore: `_b`
55+
56+
error: unused variable: `a`
57+
--> $DIR/naked-functions-unused.rs:44:43
58+
|
59+
LL | extern "C" fn trait_method(&self, a: usize, b: usize) -> usize {
60+
| ^ help: if this is intentional, prefix it with an underscore: `_a`
61+
62+
error: unused variable: `b`
63+
--> $DIR/naked-functions-unused.rs:44:53
64+
|
65+
LL | extern "C" fn trait_method(&self, a: usize, b: usize) -> usize {
66+
| ^ help: if this is intentional, prefix it with an underscore: `_b`
67+
68+
error: aborting due to 10 previous errors
69+

‎src/test/ui/asm/naked-functions.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
// needs-asm-support
2+
// ignore-nvptx64
3+
// ignore-spirv
4+
// ignore-wasm32
5+
26
#![feature(asm)]
37
#![feature(llvm_asm)]
48
#![feature(naked_functions)]

‎src/test/ui/asm/naked-functions.stderr

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
error: asm with the `pure` option must have at least one output
2-
--> $DIR/naked-functions.rs:127:14
2+
--> $DIR/naked-functions.rs:131:14
33
|
44
LL | asm!("", options(readonly, nostack), options(pure));
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^
66

77
error: patterns not allowed in naked function parameters
8-
--> $DIR/naked-functions.rs:14:5
8+
--> $DIR/naked-functions.rs:18:5
99
|
1010
LL | mut a: u32,
1111
| ^^^^^
1212

1313
error: patterns not allowed in naked function parameters
14-
--> $DIR/naked-functions.rs:16:5
14+
--> $DIR/naked-functions.rs:20:5
1515
|
1616
LL | &b: &i32,
1717
| ^^
1818

1919
error: patterns not allowed in naked function parameters
20-
--> $DIR/naked-functions.rs:18:6
20+
--> $DIR/naked-functions.rs:22:6
2121
|
2222
LL | (None | Some(_)): Option<std::ptr::NonNull<u8>>,
2323
| ^^^^^^^^^^^^^^
2424

2525
error: patterns not allowed in naked function parameters
26-
--> $DIR/naked-functions.rs:20:5
26+
--> $DIR/naked-functions.rs:24:5
2727
|
2828
LL | P { x, y }: P,
2929
| ^^^^^^^^^^
3030

3131
error: referencing function parameters is not allowed in naked functions
32-
--> $DIR/naked-functions.rs:30:5
32+
--> $DIR/naked-functions.rs:34:5
3333
|
3434
LL | a + 1
3535
| ^
3636
|
3737
= help: follow the calling convention in asm block to use parameters
3838

3939
warning: naked functions must contain a single asm block
40-
--> $DIR/naked-functions.rs:27:1
40+
--> $DIR/naked-functions.rs:31:1
4141
|
4242
LL | / pub unsafe extern "C" fn inc(a: u32) -> u32 {
4343
LL | |
@@ -53,15 +53,15 @@ LL | | }
5353
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
5454

5555
error: referencing function parameters is not allowed in naked functions
56-
--> $DIR/naked-functions.rs:36:31
56+
--> $DIR/naked-functions.rs:40:31
5757
|
5858
LL | asm!("/* {0} */", in(reg) a, options(noreturn));
5959
| ^
6060
|
6161
= help: follow the calling convention in asm block to use parameters
6262

6363
warning: only `const` and `sym` operands are supported in naked functions
64-
--> $DIR/naked-functions.rs:36:23
64+
--> $DIR/naked-functions.rs:40:23
6565
|
6666
LL | asm!("/* {0} */", in(reg) a, options(noreturn));
6767
| ^^^^^^^^^
@@ -70,7 +70,7 @@ LL | asm!("/* {0} */", in(reg) a, options(noreturn));
7070
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
7171

7272
warning: naked functions must contain a single asm block
73-
--> $DIR/naked-functions.rs:43:1
73+
--> $DIR/naked-functions.rs:47:1
7474
|
7575
LL | / pub unsafe extern "C" fn inc_closure(a: u32) -> u32 {
7676
LL | |
@@ -84,7 +84,7 @@ LL | | }
8484
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
8585

8686
warning: only `const` and `sym` operands are supported in naked functions
87-
--> $DIR/naked-functions.rs:63:10
87+
--> $DIR/naked-functions.rs:67:10
8888
|
8989
LL | in(reg) a,
9090
| ^^^^^^^^^
@@ -102,7 +102,7 @@ LL | out(reg) e,
102102
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
103103

104104
warning: asm in naked functions must use `noreturn` option
105-
--> $DIR/naked-functions.rs:60:5
105+
--> $DIR/naked-functions.rs:64:5
106106
|
107107
LL | / asm!("/* {0} {1} {2} {3} {4} {5} {6} */",
108108
LL | |
@@ -117,7 +117,7 @@ LL | | );
117117
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
118118

119119
warning: naked functions must contain a single asm block
120-
--> $DIR/naked-functions.rs:50:1
120+
--> $DIR/naked-functions.rs:54:1
121121
|
122122
LL | / pub unsafe extern "C" fn unsupported_operands() {
123123
LL | |
@@ -141,7 +141,7 @@ LL | | }
141141
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
142142

143143
warning: naked functions must contain a single asm block
144-
--> $DIR/naked-functions.rs:76:1
144+
--> $DIR/naked-functions.rs:80:1
145145
|
146146
LL | / pub extern "C" fn missing_assembly() {
147147
LL | |
@@ -153,7 +153,7 @@ LL | | }
153153
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
154154

155155
warning: asm in naked functions must use `noreturn` option
156-
--> $DIR/naked-functions.rs:85:5
156+
--> $DIR/naked-functions.rs:89:5
157157
|
158158
LL | asm!("");
159159
| ^^^^^^^^^
@@ -162,7 +162,7 @@ LL | asm!("");
162162
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
163163

164164
warning: asm in naked functions must use `noreturn` option
165-
--> $DIR/naked-functions.rs:88:5
165+
--> $DIR/naked-functions.rs:92:5
166166
|
167167
LL | asm!("");
168168
| ^^^^^^^^^
@@ -171,7 +171,7 @@ LL | asm!("");
171171
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
172172

173173
warning: asm in naked functions must use `noreturn` option
174-
--> $DIR/naked-functions.rs:91:5
174+
--> $DIR/naked-functions.rs:95:5
175175
|
176176
LL | asm!("");
177177
| ^^^^^^^^^
@@ -180,7 +180,7 @@ LL | asm!("");
180180
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
181181

182182
warning: naked functions must contain a single asm block
183-
--> $DIR/naked-functions.rs:82:1
183+
--> $DIR/naked-functions.rs:86:1
184184
|
185185
LL | / pub extern "C" fn too_many_asm_blocks() {
186186
LL | |
@@ -202,15 +202,15 @@ LL | | }
202202
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
203203

204204
error: referencing function parameters is not allowed in naked functions
205-
--> $DIR/naked-functions.rs:102:11
205+
--> $DIR/naked-functions.rs:106:11
206206
|
207207
LL | *&y
208208
| ^
209209
|
210210
= help: follow the calling convention in asm block to use parameters
211211

212212
warning: naked functions must contain a single asm block
213-
--> $DIR/naked-functions.rs:99:5
213+
--> $DIR/naked-functions.rs:103:5
214214
|
215215
LL | / pub extern "C" fn inner(y: usize) -> usize {
216216
LL | |
@@ -225,7 +225,7 @@ LL | | }
225225
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
226226

227227
warning: the LLVM-style inline assembly is unsupported in naked functions
228-
--> $DIR/naked-functions.rs:112:5
228+
--> $DIR/naked-functions.rs:116:5
229229
|
230230
LL | llvm_asm!("");
231231
| ^^^^^^^^^^^^^^
@@ -236,7 +236,7 @@ LL | llvm_asm!("");
236236
= note: this warning originates in the macro `llvm_asm` (in Nightly builds, run with -Z macro-backtrace for more info)
237237

238238
warning: naked functions must contain a single asm block
239-
--> $DIR/naked-functions.rs:109:1
239+
--> $DIR/naked-functions.rs:113:1
240240
|
241241
LL | / unsafe extern "C" fn llvm() -> ! {
242242
LL | |
@@ -252,7 +252,7 @@ LL | | }
252252
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
253253

254254
warning: asm options unsupported in naked functions: `nomem`, `preserves_flags`
255-
--> $DIR/naked-functions.rs:120:5
255+
--> $DIR/naked-functions.rs:124:5
256256
|
257257
LL | asm!("", options(nomem, preserves_flags, noreturn));
258258
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -261,7 +261,7 @@ LL | asm!("", options(nomem, preserves_flags, noreturn));
261261
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
262262

263263
warning: asm options unsupported in naked functions: `nostack`, `pure`, `readonly`
264-
--> $DIR/naked-functions.rs:127:5
264+
--> $DIR/naked-functions.rs:131:5
265265
|
266266
LL | asm!("", options(readonly, nostack), options(pure));
267267
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -270,7 +270,7 @@ LL | asm!("", options(readonly, nostack), options(pure));
270270
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
271271

272272
warning: asm in naked functions must use `noreturn` option
273-
--> $DIR/naked-functions.rs:127:5
273+
--> $DIR/naked-functions.rs:131:5
274274
|
275275
LL | asm!("", options(readonly, nostack), options(pure));
276276
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -279,21 +279,21 @@ LL | asm!("", options(readonly, nostack), options(pure));
279279
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
280280

281281
warning: Rust ABI is unsupported in naked functions
282-
--> $DIR/naked-functions.rs:136:15
282+
--> $DIR/naked-functions.rs:140:15
283283
|
284284
LL | pub unsafe fn default_abi() {
285285
| ^^^^^^^^^^^
286286
|
287287
= note: `#[warn(undefined_naked_function_abi)]` on by default
288288

289289
warning: Rust ABI is unsupported in naked functions
290-
--> $DIR/naked-functions.rs:142:29
290+
--> $DIR/naked-functions.rs:146:29
291291
|
292292
LL | pub unsafe extern "Rust" fn rust_abi() {
293293
| ^^^^^^^^
294294

295295
warning: naked functions cannot be inlined
296-
--> $DIR/naked-functions.rs:176:1
296+
--> $DIR/naked-functions.rs:180:1
297297
|
298298
LL | #[inline]
299299
| ^^^^^^^^^
@@ -302,7 +302,7 @@ LL | #[inline]
302302
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
303303

304304
warning: naked functions cannot be inlined
305-
--> $DIR/naked-functions.rs:184:1
305+
--> $DIR/naked-functions.rs:188:1
306306
|
307307
LL | #[inline(always)]
308308
| ^^^^^^^^^^^^^^^^^
@@ -311,7 +311,7 @@ LL | #[inline(always)]
311311
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
312312

313313
warning: naked functions cannot be inlined
314-
--> $DIR/naked-functions.rs:192:1
314+
--> $DIR/naked-functions.rs:196:1
315315
|
316316
LL | #[inline(never)]
317317
| ^^^^^^^^^^^^^^^^
@@ -320,7 +320,7 @@ LL | #[inline(never)]
320320
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
321321

322322
warning: naked functions cannot be inlined
323-
--> $DIR/naked-functions.rs:200:1
323+
--> $DIR/naked-functions.rs:204:1
324324
|
325325
LL | #[inline]
326326
| ^^^^^^^^^
@@ -329,7 +329,7 @@ LL | #[inline]
329329
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
330330

331331
warning: naked functions cannot be inlined
332-
--> $DIR/naked-functions.rs:203:1
332+
--> $DIR/naked-functions.rs:207:1
333333
|
334334
LL | #[inline(always)]
335335
| ^^^^^^^^^^^^^^^^^
@@ -338,7 +338,7 @@ LL | #[inline(always)]
338338
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
339339

340340
warning: naked functions cannot be inlined
341-
--> $DIR/naked-functions.rs:206:1
341+
--> $DIR/naked-functions.rs:210:1
342342
|
343343
LL | #[inline(never)]
344344
| ^^^^^^^^^^^^^^^^

‎src/test/ui/asm/named-asm-labels.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
// only-x86_64
1+
// needs-asm-support
2+
// ignore-nvptx64
3+
// ignore-spirv
4+
// ignore-wasm32
25

36
// Tests that the use of named labels in the `asm!` macro are linted against
47
// except for in `#[naked]` fns.
@@ -99,9 +102,6 @@ fn main() {
99102
asm!("\x41\x42\x43\x3A\x20\x6E\x6F\x70"); //~ ERROR avoid using named labels
100103

101104
// Non-label colons - should pass
102-
// (most of these are stolen from other places)
103-
asm!("{:l}", in(reg) 0i64);
104-
asm!("{:e}", in(reg) 0f32);
105105
asm!("mov rax, qword ptr fs:[0]");
106106

107107
// Comments

‎src/test/ui/asm/named-asm-labels.stderr

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: avoid using named labels in inline assembly
2-
--> $DIR/named-asm-labels.rs:19:15
2+
--> $DIR/named-asm-labels.rs:22:15
33
|
44
LL | asm!("bar: nop");
55
| ^^^
@@ -9,7 +9,7 @@ LL | asm!("bar: nop");
99
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
1010

1111
error: avoid using named labels in inline assembly
12-
--> $DIR/named-asm-labels.rs:22:15
12+
--> $DIR/named-asm-labels.rs:25:15
1313
|
1414
LL | asm!("abcd:");
1515
| ^^^^
@@ -18,7 +18,7 @@ LL | asm!("abcd:");
1818
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
1919

2020
error: avoid using named labels in inline assembly
21-
--> $DIR/named-asm-labels.rs:25:15
21+
--> $DIR/named-asm-labels.rs:28:15
2222
|
2323
LL | asm!("foo: bar1: nop");
2424
| ^^^ ^^^^
@@ -27,7 +27,7 @@ LL | asm!("foo: bar1: nop");
2727
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
2828

2929
error: avoid using named labels in inline assembly
30-
--> $DIR/named-asm-labels.rs:29:15
30+
--> $DIR/named-asm-labels.rs:32:15
3131
|
3232
LL | asm!("foo1: nop", "nop");
3333
| ^^^^
@@ -36,7 +36,7 @@ LL | asm!("foo1: nop", "nop");
3636
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
3737

3838
error: avoid using named labels in inline assembly
39-
--> $DIR/named-asm-labels.rs:30:15
39+
--> $DIR/named-asm-labels.rs:33:15
4040
|
4141
LL | asm!("foo2: foo3: nop", "nop");
4242
| ^^^^ ^^^^
@@ -45,7 +45,7 @@ LL | asm!("foo2: foo3: nop", "nop");
4545
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
4646

4747
error: avoid using named labels in inline assembly
48-
--> $DIR/named-asm-labels.rs:32:22
48+
--> $DIR/named-asm-labels.rs:35:22
4949
|
5050
LL | asm!("nop", "foo4: nop");
5151
| ^^^^
@@ -54,7 +54,7 @@ LL | asm!("nop", "foo4: nop");
5454
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
5555

5656
error: avoid using named labels in inline assembly
57-
--> $DIR/named-asm-labels.rs:33:15
57+
--> $DIR/named-asm-labels.rs:36:15
5858
|
5959
LL | asm!("foo5: nop", "foo6: nop");
6060
| ^^^^
@@ -63,7 +63,7 @@ LL | asm!("foo5: nop", "foo6: nop");
6363
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
6464

6565
error: avoid using named labels in inline assembly
66-
--> $DIR/named-asm-labels.rs:33:28
66+
--> $DIR/named-asm-labels.rs:36:28
6767
|
6868
LL | asm!("foo5: nop", "foo6: nop");
6969
| ^^^^
@@ -72,7 +72,7 @@ LL | asm!("foo5: nop", "foo6: nop");
7272
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
7373

7474
error: avoid using named labels in inline assembly
75-
--> $DIR/named-asm-labels.rs:38:15
75+
--> $DIR/named-asm-labels.rs:41:15
7676
|
7777
LL | asm!("foo7: nop; foo8: nop");
7878
| ^^^^ ^^^^
@@ -81,7 +81,7 @@ LL | asm!("foo7: nop; foo8: nop");
8181
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
8282

8383
error: avoid using named labels in inline assembly
84-
--> $DIR/named-asm-labels.rs:40:15
84+
--> $DIR/named-asm-labels.rs:43:15
8585
|
8686
LL | asm!("foo9: nop; nop");
8787
| ^^^^
@@ -90,7 +90,7 @@ LL | asm!("foo9: nop; nop");
9090
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
9191

9292
error: avoid using named labels in inline assembly
93-
--> $DIR/named-asm-labels.rs:41:20
93+
--> $DIR/named-asm-labels.rs:44:20
9494
|
9595
LL | asm!("nop; foo10: nop");
9696
| ^^^^^
@@ -99,7 +99,7 @@ LL | asm!("nop; foo10: nop");
9999
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
100100

101101
error: avoid using named labels in inline assembly
102-
--> $DIR/named-asm-labels.rs:44:15
102+
--> $DIR/named-asm-labels.rs:47:15
103103
|
104104
LL | asm!("bar2: nop\n bar3: nop");
105105
| ^^^^ ^^^^
@@ -108,7 +108,7 @@ LL | asm!("bar2: nop\n bar3: nop");
108108
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
109109

110110
error: avoid using named labels in inline assembly
111-
--> $DIR/named-asm-labels.rs:46:15
111+
--> $DIR/named-asm-labels.rs:49:15
112112
|
113113
LL | asm!("bar4: nop\n nop");
114114
| ^^^^
@@ -117,7 +117,7 @@ LL | asm!("bar4: nop\n nop");
117117
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
118118

119119
error: avoid using named labels in inline assembly
120-
--> $DIR/named-asm-labels.rs:47:21
120+
--> $DIR/named-asm-labels.rs:50:21
121121
|
122122
LL | asm!("nop\n bar5: nop");
123123
| ^^^^
@@ -126,7 +126,7 @@ LL | asm!("nop\n bar5: nop");
126126
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
127127

128128
error: avoid using named labels in inline assembly
129-
--> $DIR/named-asm-labels.rs:48:21
129+
--> $DIR/named-asm-labels.rs:51:21
130130
|
131131
LL | asm!("nop\n bar6: bar7: nop");
132132
| ^^^^ ^^^^
@@ -135,7 +135,7 @@ LL | asm!("nop\n bar6: bar7: nop");
135135
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
136136

137137
error: avoid using named labels in inline assembly
138-
--> $DIR/named-asm-labels.rs:54:13
138+
--> $DIR/named-asm-labels.rs:57:13
139139
|
140140
LL | blah2: nop
141141
| ^^^^^
@@ -146,7 +146,7 @@ LL | blah3: nop
146146
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
147147

148148
error: avoid using named labels in inline assembly
149-
--> $DIR/named-asm-labels.rs:63:19
149+
--> $DIR/named-asm-labels.rs:66:19
150150
|
151151
LL | nop ; blah4: nop
152152
| ^^^^^
@@ -155,7 +155,7 @@ LL | nop ; blah4: nop
155155
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
156156

157157
error: avoid using named labels in inline assembly
158-
--> $DIR/named-asm-labels.rs:77:15
158+
--> $DIR/named-asm-labels.rs:80:15
159159
|
160160
LL | asm!("blah1: 2bar: nop");
161161
| ^^^^^
@@ -164,7 +164,7 @@ LL | asm!("blah1: 2bar: nop");
164164
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
165165

166166
error: avoid using named labels in inline assembly
167-
--> $DIR/named-asm-labels.rs:80:15
167+
--> $DIR/named-asm-labels.rs:83:15
168168
|
169169
LL | asm!("def: def: nop");
170170
| ^^^
@@ -173,7 +173,7 @@ LL | asm!("def: def: nop");
173173
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
174174

175175
error: avoid using named labels in inline assembly
176-
--> $DIR/named-asm-labels.rs:81:15
176+
--> $DIR/named-asm-labels.rs:84:15
177177
|
178178
LL | asm!("def: nop\ndef: nop");
179179
| ^^^
@@ -182,7 +182,7 @@ LL | asm!("def: nop\ndef: nop");
182182
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
183183

184184
error: avoid using named labels in inline assembly
185-
--> $DIR/named-asm-labels.rs:82:15
185+
--> $DIR/named-asm-labels.rs:85:15
186186
|
187187
LL | asm!("def: nop; def: nop");
188188
| ^^^
@@ -191,7 +191,7 @@ LL | asm!("def: nop; def: nop");
191191
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
192192

193193
error: avoid using named labels in inline assembly
194-
--> $DIR/named-asm-labels.rs:90:15
194+
--> $DIR/named-asm-labels.rs:93:15
195195
|
196196
LL | asm!("fooo\u{003A} nop");
197197
| ^^^^^^^^^^^^^^^^
@@ -200,7 +200,7 @@ LL | asm!("fooo\u{003A} nop");
200200
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
201201

202202
error: avoid using named labels in inline assembly
203-
--> $DIR/named-asm-labels.rs:91:15
203+
--> $DIR/named-asm-labels.rs:94:15
204204
|
205205
LL | asm!("foooo\x3A nop");
206206
| ^^^^^^^^^^^^^
@@ -209,7 +209,7 @@ LL | asm!("foooo\x3A nop");
209209
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
210210

211211
error: avoid using named labels in inline assembly
212-
--> $DIR/named-asm-labels.rs:94:15
212+
--> $DIR/named-asm-labels.rs:97:15
213213
|
214214
LL | asm!("fooooo:\u{000A} nop");
215215
| ^^^^^^
@@ -218,7 +218,7 @@ LL | asm!("fooooo:\u{000A} nop");
218218
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
219219

220220
error: avoid using named labels in inline assembly
221-
--> $DIR/named-asm-labels.rs:95:15
221+
--> $DIR/named-asm-labels.rs:98:15
222222
|
223223
LL | asm!("foooooo:\x0A nop");
224224
| ^^^^^^^
@@ -227,7 +227,7 @@ LL | asm!("foooooo:\x0A nop");
227227
= note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
228228

229229
error: avoid using named labels in inline assembly
230-
--> $DIR/named-asm-labels.rs:99:14
230+
--> $DIR/named-asm-labels.rs:102:14
231231
|
232232
LL | asm!("\x41\x42\x43\x3A\x20\x6E\x6F\x70");
233233
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

‎src/test/ui/asm/type-check-1.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// needs-asm-support
2+
// ignore-nvptx64
3+
// ignore-spirv
4+
// ignore-wasm32
25

36
#![feature(asm, global_asm)]
47

‎src/test/ui/asm/type-check-1.stderr

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0435]: attempt to use a non-constant value in a constant
2-
--> $DIR/type-check-1.rs:34:26
2+
--> $DIR/type-check-1.rs:37:26
33
|
44
LL | let x = 0;
55
| ----- help: consider using `const` instead of `let`: `const x`
@@ -8,7 +8,7 @@ LL | asm!("{}", const x);
88
| ^ non-constant value
99

1010
error[E0435]: attempt to use a non-constant value in a constant
11-
--> $DIR/type-check-1.rs:37:36
11+
--> $DIR/type-check-1.rs:40:36
1212
|
1313
LL | let x = 0;
1414
| ----- help: consider using `const` instead of `let`: `const x`
@@ -17,7 +17,7 @@ LL | asm!("{}", const const_foo(x));
1717
| ^ non-constant value
1818

1919
error[E0435]: attempt to use a non-constant value in a constant
20-
--> $DIR/type-check-1.rs:40:36
20+
--> $DIR/type-check-1.rs:43:36
2121
|
2222
LL | let x = 0;
2323
| ----- help: consider using `const` instead of `let`: `const x`
@@ -26,13 +26,13 @@ LL | asm!("{}", const const_bar(x));
2626
| ^ non-constant value
2727

2828
error[E0308]: mismatched types
29-
--> $DIR/type-check-1.rs:48:26
29+
--> $DIR/type-check-1.rs:51:26
3030
|
3131
LL | asm!("{}", const 0f32);
3232
| ^^^^ expected integer, found `f32`
3333

3434
error[E0308]: mismatched types
35-
--> $DIR/type-check-1.rs:50:26
35+
--> $DIR/type-check-1.rs:53:26
3636
|
3737
LL | asm!("{}", const 0 as *mut u8);
3838
| ^^^^^^^^^^^^ expected integer, found *-ptr
@@ -41,7 +41,7 @@ LL | asm!("{}", const 0 as *mut u8);
4141
found raw pointer `*mut u8`
4242

4343
error[E0308]: mismatched types
44-
--> $DIR/type-check-1.rs:54:26
44+
--> $DIR/type-check-1.rs:55:26
4545
|
4646
LL | asm!("{}", const &0);
4747
| ^^ expected integer, found `&{integer}`
@@ -53,19 +53,19 @@ LL + asm!("{}", const 0);
5353
|
5454

5555
error: invalid asm output
56-
--> $DIR/type-check-1.rs:10:29
56+
--> $DIR/type-check-1.rs:13:29
5757
|
5858
LL | asm!("{}", out(reg) 1 + 2);
5959
| ^^^^^ cannot assign to this expression
6060

6161
error: invalid asm output
62-
--> $DIR/type-check-1.rs:12:31
62+
--> $DIR/type-check-1.rs:15:31
6363
|
6464
LL | asm!("{}", inout(reg) 1 + 2);
6565
| ^^^^^ cannot assign to this expression
6666

6767
error[E0277]: the size for values of type `[u64]` cannot be known at compilation time
68-
--> $DIR/type-check-1.rs:18:28
68+
--> $DIR/type-check-1.rs:21:28
6969
|
7070
LL | asm!("{}", in(reg) v[..]);
7171
| ^^^^^ doesn't have a size known at compile-time
@@ -74,7 +74,7 @@ LL | asm!("{}", in(reg) v[..]);
7474
= note: all inline asm arguments must have a statically known size
7575

7676
error[E0277]: the size for values of type `[u64]` cannot be known at compilation time
77-
--> $DIR/type-check-1.rs:20:29
77+
--> $DIR/type-check-1.rs:23:29
7878
|
7979
LL | asm!("{}", out(reg) v[..]);
8080
| ^^^^^ doesn't have a size known at compile-time
@@ -83,7 +83,7 @@ LL | asm!("{}", out(reg) v[..]);
8383
= note: all inline asm arguments must have a statically known size
8484

8585
error[E0277]: the size for values of type `[u64]` cannot be known at compilation time
86-
--> $DIR/type-check-1.rs:22:31
86+
--> $DIR/type-check-1.rs:25:31
8787
|
8888
LL | asm!("{}", inout(reg) v[..]);
8989
| ^^^^^ doesn't have a size known at compile-time
@@ -92,13 +92,13 @@ LL | asm!("{}", inout(reg) v[..]);
9292
= note: all inline asm arguments must have a statically known size
9393

9494
error[E0308]: mismatched types
95-
--> $DIR/type-check-1.rs:60:25
95+
--> $DIR/type-check-1.rs:65:25
9696
|
9797
LL | global_asm!("{}", const 0f32);
9898
| ^^^^ expected integer, found `f32`
9999

100100
error[E0308]: mismatched types
101-
--> $DIR/type-check-1.rs:64:25
101+
--> $DIR/type-check-1.rs:67:25
102102
|
103103
LL | global_asm!("{}", const 0 as *mut u8);
104104
| ^^^^^^^^^^^^ expected integer, found *-ptr

‎src/test/ui/asm/type-check-4.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// needs-asm-support
2+
// ignore-nvptx64
3+
// ignore-spirv
4+
// ignore-wasm32
25

36
#![feature(asm)]
47

‎src/test/ui/asm/type-check-4.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0506]: cannot assign to `a` because it is borrowed
2-
--> $DIR/type-check-4.rs:11:9
2+
--> $DIR/type-check-4.rs:14:9
33
|
44
LL | let p = &a;
55
| -- borrow of `a` occurs here
@@ -10,7 +10,7 @@ LL | println!("{}", p);
1010
| - borrow later used here
1111

1212
error[E0503]: cannot use `a` because it was mutably borrowed
13-
--> $DIR/type-check-4.rs:19:28
13+
--> $DIR/type-check-4.rs:22:28
1414
|
1515
LL | let p = &mut a;
1616
| ------ borrow of `a` occurs here

0 commit comments

Comments
 (0)
This repository has been archived.