"Unexpected end of macro invocation" error in nested macro has misleading span, doesn't specify which macro #33871
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The following code (based on a test case by @apoelstra):
generates this error message:
The problem is that
assert_eq!
is expecting a comma. This is very hard to decipher though, because the span points to the outer macro invocation. (This may be related to #26615.) If a better span can't be found, it would be useful to at least include the name of the macro in the error message, e.g. "unepected end ofassert_eq!
invocation."The text was updated successfully, but these errors were encountered: