global_asm! does not register location information to LLVM, resulting in suboptimal error reporting. #81751
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-inline-assembly
Area: Inline assembly (`asm!(…)`)
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Quick example (run on playground):
Current error output is:
The reason
asm!
has location information is because it attaches!srcloc
metadata on thecall asm
instruction, whereasglobal_asm!
does nothing of the sort.It's not clear from the LLVM documentation whether
!srcloc
(or something equivalent) is supported formodule asm
, so this might be blocked on LLVM implementing it in the first place.This came up as @Jasper-Bekkers tried iimplementing
AsmMethods::codegen_global_asm
forrustc_codegen_spirv
and noticed there was noSpan
being passed, and (presumably the more worrying aspect) thathir::GlobalAsm
contains noSpan
either - it probably should (given thathir::InlineAsm
hasline_spans: &[Span]
).cc @Amanieu @mrhota
The text was updated successfully, but these errors were encountered: