diff options
| author | Folkert <folkert@folkertdev.nl> | 2024-07-26 00:20:59 +0200 |
|---|---|---|
| committer | Folkert <folkert@folkertdev.nl> | 2024-07-26 00:20:59 +0200 |
| commit | 8859da0bf2f1f3d447ce1939647e88a0302afb99 (patch) | |
| tree | 8635e433dc27b53db52086b15bb1513c6c5f8cf8 | |
| parent | 73fde1701762e82227cd9fe588b06ee15719d252 (diff) | |
| download | rust-8859da0bf2f1f3d447ce1939647e88a0302afb99.tar.gz rust-8859da0bf2f1f3d447ce1939647e88a0302afb99.zip | |
add `run-rustfix` test for machine-applicable suggestion
| -rw-r--r-- | tests/ui/asm/unsupported-option.fixed | 10 | ||||
| -rw-r--r-- | tests/ui/asm/unsupported-option.rs | 10 | ||||
| -rw-r--r-- | tests/ui/asm/unsupported-option.stderr | 20 |
3 files changed, 40 insertions, 0 deletions
diff --git a/tests/ui/asm/unsupported-option.fixed b/tests/ui/asm/unsupported-option.fixed new file mode 100644 index 00000000000..c2ff13bbc55 --- /dev/null +++ b/tests/ui/asm/unsupported-option.fixed @@ -0,0 +1,10 @@ +//@ run-rustfix + +use std::arch::global_asm; + +fn main() {} + +global_asm!("", options(att_syntax, raw)); +//~^ ERROR the `nomem` option cannot be used with `global_asm!` +//~| ERROR the `readonly` option cannot be used with `global_asm!` +//~| ERROR the `noreturn` option cannot be used with `global_asm!` diff --git a/tests/ui/asm/unsupported-option.rs b/tests/ui/asm/unsupported-option.rs new file mode 100644 index 00000000000..672aedf230c --- /dev/null +++ b/tests/ui/asm/unsupported-option.rs @@ -0,0 +1,10 @@ +//@ run-rustfix + +use std::arch::global_asm; + +fn main() {} + +global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw)); +//~^ ERROR the `nomem` option cannot be used with `global_asm!` +//~| ERROR the `readonly` option cannot be used with `global_asm!` +//~| ERROR the `noreturn` option cannot be used with `global_asm!` diff --git a/tests/ui/asm/unsupported-option.stderr b/tests/ui/asm/unsupported-option.stderr new file mode 100644 index 00000000000..c040b0364d7 --- /dev/null +++ b/tests/ui/asm/unsupported-option.stderr @@ -0,0 +1,20 @@ +error: the `nomem` option cannot be used with `global_asm!` + --> $DIR/unsupported-option.rs:7:37 + | +LL | global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw)); + | ^^^^^ the `nomem` option is not meaningful for global-scoped inline assembly + +error: the `readonly` option cannot be used with `global_asm!` + --> $DIR/unsupported-option.rs:7:44 + | +LL | global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw)); + | ^^^^^^^^ the `readonly` option is not meaningful for global-scoped inline assembly + +error: the `noreturn` option cannot be used with `global_asm!` + --> $DIR/unsupported-option.rs:7:54 + | +LL | global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw)); + | ^^^^^^^^ the `noreturn` option is not meaningful for global-scoped inline assembly + +error: aborting due to 3 previous errors + |
