Support #[allow] etc logic on a per macro level
This commit extends the current unused macro linter to support directives like #[allow(unused_macros)] or #[deny(unused_macros)] directly next to the macro definition, or in one of the modules the macro is inside. Before, we only supported such directives at a per crate level, due to the crate's NodeId being passed to session.add_lint. We also had to implement handling of the macro's NodeId in the lint visitor.
This commit is contained in:
@@ -535,7 +535,7 @@ pub enum SyntaxExtension {
|
||||
///
|
||||
/// The `bool` dictates whether the contents of the macro can
|
||||
/// directly use `#[unstable]` things (true == yes).
|
||||
NormalTT(Box<TTMacroExpander>, Option<Span>, bool),
|
||||
NormalTT(Box<TTMacroExpander>, Option<(ast::NodeId, Span)>, bool),
|
||||
|
||||
/// A function-like syntax extension that has an extra ident before
|
||||
/// the block.
|
||||
|
||||
Reference in New Issue
Block a user