mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
parent
c15bae53b5
commit
9abdb6db6f
@ -1067,7 +1067,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
||||
.collect();
|
||||
|
||||
// Stop if there were any errors when lowering the register classes
|
||||
if operands.len() != asm.operands.len() {
|
||||
if operands.len() != asm.operands.len() || sess.asm_arch.is_none() {
|
||||
return hir::ExprKind::Err;
|
||||
}
|
||||
|
||||
|
18
src/test/ui/asm/bad-arch.rs
Normal file
18
src/test/ui/asm/bad-arch.rs
Normal file
@ -0,0 +1,18 @@
|
||||
// compile-flags: --target wasm32-unknown-unknown
|
||||
|
||||
#![feature(no_core, lang_items, rustc_attrs)]
|
||||
#![no_core]
|
||||
|
||||
#[rustc_builtin_macro]
|
||||
macro_rules! asm {
|
||||
() => {};
|
||||
}
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
asm!("");
|
||||
//~^ ERROR asm! is unsupported on this target
|
||||
}
|
||||
}
|
8
src/test/ui/asm/bad-arch.stderr
Normal file
8
src/test/ui/asm/bad-arch.stderr
Normal file
@ -0,0 +1,8 @@
|
||||
error[E0472]: asm! is unsupported on this target
|
||||
--> $DIR/bad-arch.rs:15:9
|
||||
|
|
||||
LL | asm!("");
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-emscripten
|
||||
// only-x86_64
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-emscripten
|
||||
// only-x86_64
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
Loading…
Reference in New Issue
Block a user