pallet::call macro does not preserve lint attributes #249
Labels
I5-enhancement
An additional feature request.
T1-FRAME
This PR/Issue is related to core FRAME, the framework.
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
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
, andwarn
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
The text was updated successfully, but these errors were encountered: