]> git.lizzy.rs Git - rust.git/commit
Support #[allow] etc logic on a per macro level
authorest31 <MTest31@outlook.com>
Fri, 12 May 2017 06:10:52 +0000 (08:10 +0200)
committerest31 <MTest31@outlook.com>
Sat, 13 May 2017 14:02:29 +0000 (16:02 +0200)
commitd14d194f61bfd775411c2450e1d939bbb06542b9
tree32a833a4a79f662d1aac206706d9623d042e457a
parentdb82c57cb7ff7f4f629ceeaefdbc693d2886fda7
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.
src/librustc/lint/context.rs
src/librustc_plugin/registry.rs
src/librustc_resolve/macros.rs
src/libsyntax/ext/base.rs
src/libsyntax/ext/expand.rs
src/libsyntax/ext/tt/macro_rules.rs