Remove automatic rustfix of asm! to llvm_asm!

This no longer works now that asm! needs an explicit import. Also, it's
been over a year since asm! landed, everyone should have transitioned by
now.
This commit is contained in:
Amanieu d'Antras 2021-12-09 18:48:19 +00:00
parent a0a4c7d1e4
commit b3a55371a7
4 changed files with 0 additions and 71 deletions

View File

@ -42,19 +42,6 @@ fn parse_args<'a>(
ecx.struct_span_err(sp, "the legacy LLVM-style asm! syntax is no longer supported");
err.note("consider migrating to the new asm! syntax specified in RFC 2873");
err.note("alternatively, switch to llvm_asm! to keep your code working as it is");
// Find the span of the "asm!" so that we can offer an automatic suggestion
let asm_span = sp.from_inner(InnerSpan::new(0, 4));
if let Ok(s) = ecx.source_map().span_to_snippet(asm_span) {
if s == "asm!" {
err.span_suggestion(
asm_span,
"replace with",
"llvm_asm!".into(),
Applicability::MachineApplicable,
);
}
}
return Err(err);
}

View File

@ -1,17 +0,0 @@
// run-rustfix
// needs-asm-support
#![feature(asm, llvm_asm)]
#![allow(deprecated)] // llvm_asm!
fn main() {
unsafe {
let x = 1;
let y: i32;
llvm_asm!("" :: "r" (x));
//~^ ERROR the legacy LLVM-style asm! syntax is no longer supported
llvm_asm!("" : "=r" (y));
//~^ ERROR the legacy LLVM-style asm! syntax is no longer supported
let _ = y;
}
}

View File

@ -1,17 +0,0 @@
// run-rustfix
// needs-asm-support
#![feature(asm, llvm_asm)]
#![allow(deprecated)] // llvm_asm!
fn main() {
unsafe {
let x = 1;
let y: i32;
asm!("" :: "r" (x));
//~^ ERROR the legacy LLVM-style asm! syntax is no longer supported
asm!("" : "=r" (y));
//~^ ERROR the legacy LLVM-style asm! syntax is no longer supported
let _ = y;
}
}

View File

@ -1,24 +0,0 @@
error: the legacy LLVM-style asm! syntax is no longer supported
--> $DIR/rustfix-asm.rs:11:9
|
LL | asm!("" :: "r" (x));
| ----^^^^^^^^^^^^^^^
| |
| help: replace with: `llvm_asm!`
|
= note: consider migrating to the new asm! syntax specified in RFC 2873
= note: alternatively, switch to llvm_asm! to keep your code working as it is
error: the legacy LLVM-style asm! syntax is no longer supported
--> $DIR/rustfix-asm.rs:13:9
|
LL | asm!("" : "=r" (y));
| ----^^^^^^^^^^^^^^^
| |
| help: replace with: `llvm_asm!`
|
= note: consider migrating to the new asm! syntax specified in RFC 2873
= note: alternatively, switch to llvm_asm! to keep your code working as it is
error: aborting due to 2 previous errors