improve error message for using unbound 'self' in macro #26946
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
I just mistakenly tried to naively use
self
in a macro (which is only invoked by a method taking self), and got the error:As described in #15682, failure is intended due to hygiene. However, the error message is inaccurate, because a macro body is not a static method. It should be changed to take this case into account.
The text was updated successfully, but these errors were encountered: