Better diagnostics for proc macro attributes #102923
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.
Given the following code:
The current output is:
The compiler knows the meaning of
#[proc_macro*]
attributes, so it could provide more helpful error messages. TheProcMacro::custom_derive
etc types are not part of the API that the users normally work with, so listing them is unhelpful. Since the signatures of proc macro functions are fixed, the compiler can directly list them:Note that the signature includes the function name and argument names, allowing the proper signature to be copy-pasted in code. This also disambiguates arguments for attribute proc macros, where there may be confusion w.r.t. order of arguments.
The text was updated successfully, but these errors were encountered: