Syntax errors in assembly included from another file produce confusing output #91307
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The following is a sufficiently supported pattern in Rust to get a mention in the unstable book.
However, if the included assembly contains a syntax error (such as the ARM instruction
push {r2, r3, r12, lr}
- the solution* is to double the curly brackets to prevent the compiler from interpreting them as a template string) the error you get is somewhat confusing since it blames a seemingly arbitrary point potentially in a completely different source file from the actual error.The correct error here would presumably look something like this.
This may be related to #81751 - I'm not familiar enough with compiler internals to say, so I erred on the side of posting a new issue.
*or at least a solution - another would be to special-case this pattern as unable to use template strings
The text was updated successfully, but these errors were encountered: