Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions tests/ui/asm/bad-template.aarch64.stderr
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
error: invalid reference to argument at index 0
--> $DIR/bad-template.rs:20:15
--> $DIR/bad-template.rs:22:15
|
LL | asm!("{}");
| ^^ from here
|
= note: no arguments were given

error: invalid reference to argument at index 1
--> $DIR/bad-template.rs:22:15
--> $DIR/bad-template.rs:24:15
|
LL | asm!("{1}", in(reg) foo);
| ^^^ from here
|
= note: there is 1 argument

error: argument never used
--> $DIR/bad-template.rs:22:21
--> $DIR/bad-template.rs:24:21
|
LL | asm!("{1}", in(reg) foo);
| ^^^^^^^^^^^ argument never used
|
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {0} */"`

error: there is no argument named `a`
--> $DIR/bad-template.rs:25:16
--> $DIR/bad-template.rs:27:16
|
LL | asm!("{a}");
| ^

error: invalid reference to argument at index 0
--> $DIR/bad-template.rs:27:15
--> $DIR/bad-template.rs:29:15
|
LL | asm!("{}", a = in(reg) foo);
| ^^ --------------- named argument
Expand All @@ -38,37 +38,37 @@ LL | asm!("{}", a = in(reg) foo);
|
= note: no positional arguments were given
note: named arguments cannot be referenced by position
--> $DIR/bad-template.rs:27:20
--> $DIR/bad-template.rs:29:20
|
LL | asm!("{}", a = in(reg) foo);
| ^^^^^^^^^^^^^^^

error: named argument never used
--> $DIR/bad-template.rs:27:20
--> $DIR/bad-template.rs:29:20
|
LL | asm!("{}", a = in(reg) foo);
| ^^^^^^^^^^^^^^^ named argument never used
|
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"`

error: invalid reference to argument at index 1
--> $DIR/bad-template.rs:30:15
--> $DIR/bad-template.rs:32:15
|
LL | asm!("{1}", a = in(reg) foo);
| ^^^ from here
|
= note: no positional arguments were given

error: named argument never used
--> $DIR/bad-template.rs:30:21
--> $DIR/bad-template.rs:32:21
|
LL | asm!("{1}", a = in(reg) foo);
| ^^^^^^^^^^^^^^^ named argument never used
|
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"`

error: invalid reference to argument at index 0
--> $DIR/bad-template.rs:37:15
--> $DIR/bad-template.rs:39:15
|
LL | asm!("{}", in("x0") foo);
| ^^ ------------ explicit register argument
Expand All @@ -77,24 +77,24 @@ LL | asm!("{}", in("x0") foo);
|
= note: no positional arguments were given
note: explicit register arguments cannot be used in the asm template
--> $DIR/bad-template.rs:37:20
--> $DIR/bad-template.rs:39:20
|
LL | asm!("{}", in("x0") foo);
| ^^^^^^^^^^^^
help: use the register name directly in the assembly code
--> $DIR/bad-template.rs:37:20
--> $DIR/bad-template.rs:39:20
|
LL | asm!("{}", in("x0") foo);
| ^^^^^^^^^^^^

error: asm template modifier must be a single character
--> $DIR/bad-template.rs:39:17
--> $DIR/bad-template.rs:41:17
|
LL | asm!("{:foo}", in(reg) foo);
| ^^^

error: multiple unused asm arguments
--> $DIR/bad-template.rs:42:18
--> $DIR/bad-template.rs:44:18
|
LL | asm!("", in(reg) 0, in(reg) 1);
| ^^^^^^^^^ ^^^^^^^^^ argument never used
Expand All @@ -104,37 +104,37 @@ LL | asm!("", in(reg) 0, in(reg) 1);
= help: if these arguments are intentionally unused, consider using them in an asm comment: `"/* {0} {1} */"`

error: invalid reference to argument at index 0
--> $DIR/bad-template.rs:48:14
--> $DIR/bad-template.rs:50:14
|
LL | global_asm!("{}");
| ^^ from here
|
= note: no arguments were given

error: invalid reference to argument at index 1
--> $DIR/bad-template.rs:50:14
--> $DIR/bad-template.rs:52:14
|
LL | global_asm!("{1}", const FOO);
| ^^^ from here
|
= note: there is 1 argument

error: argument never used
--> $DIR/bad-template.rs:50:20
--> $DIR/bad-template.rs:52:20
|
LL | global_asm!("{1}", const FOO);
| ^^^^^^^^^ argument never used
|
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {0} */"`

error: there is no argument named `a`
--> $DIR/bad-template.rs:53:15
--> $DIR/bad-template.rs:55:15
|
LL | global_asm!("{a}");
| ^

error: invalid reference to argument at index 0
--> $DIR/bad-template.rs:55:14
--> $DIR/bad-template.rs:57:14
|
LL | global_asm!("{}", a = const FOO);
| ^^ ------------- named argument
Expand All @@ -143,43 +143,43 @@ LL | global_asm!("{}", a = const FOO);
|
= note: no positional arguments were given
note: named arguments cannot be referenced by position
--> $DIR/bad-template.rs:55:19
--> $DIR/bad-template.rs:57:19
|
LL | global_asm!("{}", a = const FOO);
| ^^^^^^^^^^^^^

error: named argument never used
--> $DIR/bad-template.rs:55:19
--> $DIR/bad-template.rs:57:19
|
LL | global_asm!("{}", a = const FOO);
| ^^^^^^^^^^^^^ named argument never used
|
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"`

error: invalid reference to argument at index 1
--> $DIR/bad-template.rs:58:14
--> $DIR/bad-template.rs:60:14
|
LL | global_asm!("{1}", a = const FOO);
| ^^^ from here
|
= note: no positional arguments were given

error: named argument never used
--> $DIR/bad-template.rs:58:20
--> $DIR/bad-template.rs:60:20
|
LL | global_asm!("{1}", a = const FOO);
| ^^^^^^^^^^^^^ named argument never used
|
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"`

error: asm template modifier must be a single character
--> $DIR/bad-template.rs:61:16
--> $DIR/bad-template.rs:63:16
|
LL | global_asm!("{:foo}", const FOO);
| ^^^

error: multiple unused asm arguments
--> $DIR/bad-template.rs:63:17
--> $DIR/bad-template.rs:65:17
|
LL | global_asm!("", const FOO, const FOO);
| ^^^^^^^^^ ^^^^^^^^^ argument never used
Expand All @@ -189,7 +189,7 @@ LL | global_asm!("", const FOO, const FOO);
= help: if these arguments are intentionally unused, consider using them in an asm comment: `"/* {0} {1} */"`

warning: formatting may not be suitable for sub-register argument
--> $DIR/bad-template.rs:39:15
--> $DIR/bad-template.rs:41:15
|
LL | asm!("{:foo}", in(reg) foo);
| ^^^^^^ --- for this argument
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/asm/bad-template.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//@ add-minicore
//@ revisions: x86_64 aarch64
//@ reference: asm.ts-args.at-least-once
//@ reference: asm.template-modifiers.only-one

//@ [x86_64] compile-flags: --target x86_64-unknown-linux-gnu
//@ [aarch64] compile-flags: --target aarch64-unknown-linux-gnu
Expand Down
Loading
Loading