diff options
| author | Alex Macleod <alex@macleod.io> | 2022-07-31 15:11:00 +0000 |
|---|---|---|
| committer | Alex Macleod <alex@macleod.io> | 2022-07-31 15:11:33 +0000 |
| commit | 2a0b51d852e3765d257284f91fc3246084c96ee5 (patch) | |
| tree | 07555af30e2578d89e2798dc261691868be2a017 /compiler/rustc_builtin_macros/src/asm.rs | |
| parent | 482153bc208df5fc236cc0e1cddb24e93fcc332f (diff) | |
| download | rust-2a0b51d852e3765d257284f91fc3246084c96ee5.tar.gz rust-2a0b51d852e3765d257284f91fc3246084c96ee5.zip | |
Always include a position span in rustc_parse_format::Argument
Diffstat (limited to 'compiler/rustc_builtin_macros/src/asm.rs')
| -rw-r--r-- | compiler/rustc_builtin_macros/src/asm.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_builtin_macros/src/asm.rs b/compiler/rustc_builtin_macros/src/asm.rs index a2205c3613d..bb64394e21e 100644 --- a/compiler/rustc_builtin_macros/src/asm.rs +++ b/compiler/rustc_builtin_macros/src/asm.rs @@ -656,7 +656,7 @@ fn expand_preparsed_asm(ecx: &mut ExtCtxt<'_>, args: AsmArgs) -> Option<ast::Inl let span = arg_spans.next().unwrap_or(template_sp); let operand_idx = match arg.position { - parse::ArgumentIs(idx, _) | parse::ArgumentImplicitlyIs(idx) => { + parse::ArgumentIs(idx) | parse::ArgumentImplicitlyIs(idx) => { if idx >= args.operands.len() || named_pos.contains_key(&idx) || args.reg_args.contains(&idx) @@ -702,11 +702,12 @@ fn expand_preparsed_asm(ecx: &mut ExtCtxt<'_>, args: AsmArgs) -> Option<ast::Inl Some(idx) } } - parse::ArgumentNamed(name, span) => { + parse::ArgumentNamed(name) => { match args.named_args.get(&Symbol::intern(name)) { Some(&idx) => Some(idx), None => { let msg = format!("there is no argument named `{}`", name); + let span = arg.position_span; ecx.struct_span_err( template_span .from_inner(InnerSpan::new(span.start, span.end)), |
