add run-rustfix test for machine-applicable suggestion

This commit is contained in:
Folkert 2024-07-26 00:20:59 +02:00
parent 73fde17017
commit 8859da0bf2
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
3 changed files with 40 additions and 0 deletions

View file

@ -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!`

View file

@ -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!`

View file

@ -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