pallet::call macro does not preserve lint attributes
Is there an existing issue?
- [X] I have searched the existing issues
Experiencing problems? Have you tried our Stack Exchange first?
- [X] This is not a support question.
Description of bug
The pallet procedural macro does not preserve any attributes on fns in a #[pallet::call] impl. This means that it is impossible to add a #[allow(lint)] or #[deny(lint)] attribute to a given call and have it be known/respected by the compiler.
It may make sense to filter unknown attributes from call fns in most cases, since they could be other procedural macros which could change things in ways that would break the expected contract of a call. However, I think that for developer ergonomics the lint macros should still be passed on to the compiler.
I believe that preserving allow, deny, and warn attributes is a fairly straightforward addition to the proc macro.
The workaround is to just use a global #![allow(lint)] for the entire crate, but that is less than ideal as it can mask new instances of a warning that a developer may care about.
Steps to reproduce
No response
@sam0x17