Rollup merge of #99192 - Amanieu:fix-asm-srcloc, r=petrochenkov
Fix spans for asm diagnostics Line spans were incorrect if the first line of an asm statement was an empty string.
This commit is contained in:
commit
d3a1aa0b43
5 changed files with 42 additions and 4 deletions
|
@ -534,8 +534,8 @@ fn expand_preparsed_asm(ecx: &mut ExtCtxt<'_>, args: AsmArgs) -> Option<ast::Inl
|
|||
|
||||
let mut template_strs = Vec::with_capacity(args.templates.len());
|
||||
|
||||
for template_expr in args.templates.into_iter() {
|
||||
if !template.is_empty() {
|
||||
for (i, template_expr) in args.templates.into_iter().enumerate() {
|
||||
if i != 0 {
|
||||
template.push(ast::InlineAsmTemplatePiece::String("\n".to_string()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue