Skip to content

Commit

Permalink
add run-rustfix test for machine-applicable suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertdev committed Jul 25, 2024
1 parent 73fde17 commit 8859da0
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/ui/asm/unsupported-option.fixed
Original file line number Diff line number Diff line change
@@ -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!`
10 changes: 10 additions & 0 deletions tests/ui/asm/unsupported-option.rs
Original file line number Diff line number Diff line change
@@ -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!`
20 changes: 20 additions & 0 deletions tests/ui/asm/unsupported-option.stderr
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8859da0

Please sign in to comment.