Skip to content

Commit 8859da0

Browse files
committed
add run-rustfix test for machine-applicable suggestion
1 parent 73fde17 commit 8859da0

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

tests/ui/asm/unsupported-option.fixed

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//@ run-rustfix
2+
3+
use std::arch::global_asm;
4+
5+
fn main() {}
6+
7+
global_asm!("", options(att_syntax, raw));
8+
//~^ ERROR the `nomem` option cannot be used with `global_asm!`
9+
//~| ERROR the `readonly` option cannot be used with `global_asm!`
10+
//~| ERROR the `noreturn` option cannot be used with `global_asm!`

tests/ui/asm/unsupported-option.rs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//@ run-rustfix
2+
3+
use std::arch::global_asm;
4+
5+
fn main() {}
6+
7+
global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw));
8+
//~^ ERROR the `nomem` option cannot be used with `global_asm!`
9+
//~| ERROR the `readonly` option cannot be used with `global_asm!`
10+
//~| ERROR the `noreturn` option cannot be used with `global_asm!`
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error: the `nomem` option cannot be used with `global_asm!`
2+
--> $DIR/unsupported-option.rs:7:37
3+
|
4+
LL | global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw));
5+
| ^^^^^ the `nomem` option is not meaningful for global-scoped inline assembly
6+
7+
error: the `readonly` option cannot be used with `global_asm!`
8+
--> $DIR/unsupported-option.rs:7:44
9+
|
10+
LL | global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw));
11+
| ^^^^^^^^ the `readonly` option is not meaningful for global-scoped inline assembly
12+
13+
error: the `noreturn` option cannot be used with `global_asm!`
14+
--> $DIR/unsupported-option.rs:7:54
15+
|
16+
LL | global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw));
17+
| ^^^^^^^^ the `noreturn` option is not meaningful for global-scoped inline assembly
18+
19+
error: aborting due to 3 previous errors
20+

0 commit comments

Comments
 (0)