Clarify error message when both asm! and global_asm! are unsupported
This commit is contained in:
parent
0df83f8e5e
commit
bb6bec1d55
3 changed files with 6 additions and 5 deletions
|
@ -15,7 +15,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
||||||
// lowering the register contraints in this case.
|
// lowering the register contraints in this case.
|
||||||
let asm_arch = if self.sess.opts.actually_rustdoc { None } else { self.sess.asm_arch };
|
let asm_arch = if self.sess.opts.actually_rustdoc { None } else { self.sess.asm_arch };
|
||||||
if asm_arch.is_none() && !self.sess.opts.actually_rustdoc {
|
if asm_arch.is_none() && !self.sess.opts.actually_rustdoc {
|
||||||
struct_span_err!(self.sess, sp, E0472, "asm! is unsupported on this target").emit();
|
struct_span_err!(self.sess, sp, E0472, "inline assembly is unsupported on this target")
|
||||||
|
.emit();
|
||||||
}
|
}
|
||||||
if asm.options.contains(InlineAsmOptions::ATT_SYNTAX)
|
if asm.options.contains(InlineAsmOptions::ATT_SYNTAX)
|
||||||
&& !matches!(asm_arch, Some(asm::InlineAsmArch::X86 | asm::InlineAsmArch::X86_64))
|
&& !matches!(asm_arch, Some(asm::InlineAsmArch::X86 | asm::InlineAsmArch::X86_64))
|
||||||
|
|
|
@ -18,9 +18,9 @@ trait Sized {}
|
||||||
fn main() {
|
fn main() {
|
||||||
unsafe {
|
unsafe {
|
||||||
asm!("");
|
asm!("");
|
||||||
//~^ ERROR asm! is unsupported on this target
|
//~^ ERROR inline assembly is unsupported on this target
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
global_asm!("");
|
global_asm!("");
|
||||||
//~^ ERROR asm! is unsupported on this target
|
//~^ ERROR inline assembly is unsupported on this target
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
error[E0472]: asm! is unsupported on this target
|
error[E0472]: inline assembly is unsupported on this target
|
||||||
--> $DIR/bad-arch.rs:20:9
|
--> $DIR/bad-arch.rs:20:9
|
||||||
|
|
|
|
||||||
LL | asm!("");
|
LL | asm!("");
|
||||||
| ^^^^^^^^^
|
| ^^^^^^^^^
|
||||||
|
|
||||||
error[E0472]: asm! is unsupported on this target
|
error[E0472]: inline assembly is unsupported on this target
|
||||||
--> $DIR/bad-arch.rs:25:1
|
--> $DIR/bad-arch.rs:25:1
|
||||||
|
|
|
|
||||||
LL | global_asm!("");
|
LL | global_asm!("");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue