Add support for specifying multiple clobber_abi in `asm!` by asquared31415 · Pul...
source link: https://github.com/rust-lang/rust/pull/89316
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Outdated
@@ -2744,7 +2744,7 @@ pub enum ItemKind {
}
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(ItemKind, 112);
@@ -27,11 +28,13 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
.emit();
}
let mut clobber_abi = None;
let mut clobber_abis = FxHashSet::default();
compiler/rustc_ast_lowering/src/asm.rs
Outdated Show resolved
@@ -210,7 +210,7 @@ fn parse_args<'a>(
.span_labels(args.options_spans.clone(), "previous options")
.span_label(span, "argument")
.emit();
} else if let Some((_, abi_span)) = args.clobber_abi {
} else if let Some(&(_, abi_span)) = args.clobber_abis.last() {
ecx.struct_span_err(span, "arguments are not allowed after clobber_abi")
.span_label(abi_span, "clobber_abi")
@@ -322,7 +322,7 @@ fn parse_args<'a>(
// Bail out now since this is likely to confuse MIR
return Err(err);
}
if let Some((_, abi_span)) = args.clobber_abi {
if let Some(&(_, abi_span)) = args.clobber_abis.last() {
if is_global_asm {
let err =
ecx.struct_span_err(abi_span, "`clobber_abi` cannot be used with `global_asm!`");
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK