Rollup merge of #58785 - euclio:tool-lint-attrs, r=estebank
allow specifying attributes for tool lints Needed for clippy to fix `unused_doc_comments` warnings that will be exposed by #57882 (and thus unblock it).
This commit is contained in:
commit
4aebce5758
@ -132,14 +132,22 @@ macro_rules! declare_lint {
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! declare_tool_lint {
|
||||
($vis: vis $tool: ident ::$NAME: ident, $Level: ident, $desc: expr) => (
|
||||
declare_tool_lint!{$vis $tool::$NAME, $Level, $desc, false}
|
||||
(
|
||||
$(#[$attr:meta])* $vis:vis $tool:ident ::$NAME:ident, $Level: ident, $desc: expr
|
||||
) => (
|
||||
declare_tool_lint!{$(#[$attr])* $vis $tool::$NAME, $Level, $desc, false}
|
||||
);
|
||||
($vis: vis $tool: ident ::$NAME: ident, $Level: ident, $desc: expr,
|
||||
report_in_external_macro: $rep: expr) => (
|
||||
declare_tool_lint!{$vis $tool::$NAME, $Level, $desc, $rep}
|
||||
(
|
||||
$(#[$attr:meta])* $vis:vis $tool:ident ::$NAME:ident, $Level:ident, $desc:expr,
|
||||
report_in_external_macro: $rep:expr
|
||||
) => (
|
||||
declare_tool_lint!{$(#[$attr])* $vis $tool::$NAME, $Level, $desc, $rep}
|
||||
);
|
||||
($vis: vis $tool: ident ::$NAME: ident, $Level: ident, $desc: expr, $external: expr) => (
|
||||
(
|
||||
$(#[$attr:meta])* $vis:vis $tool:ident ::$NAME:ident, $Level:ident, $desc:expr,
|
||||
$external:expr
|
||||
) => (
|
||||
$(#[$attr])*
|
||||
$vis static $NAME: &$crate::lint::Lint = &$crate::lint::Lint {
|
||||
name: &concat!(stringify!($tool), "::", stringify!($NAME)),
|
||||
default_level: $crate::lint::$Level,
|
||||
|
@ -13,7 +13,11 @@ use rustc::lint::{EarlyContext, LintContext, LintPass, EarlyLintPass,
|
||||
use rustc_plugin::Registry;
|
||||
use syntax::ast;
|
||||
declare_tool_lint!(pub clippy::TEST_LINT, Warn, "Warn about stuff");
|
||||
declare_tool_lint!(pub clippy::TEST_GROUP, Warn, "Warn about other stuff");
|
||||
declare_tool_lint!(
|
||||
/// Some docs
|
||||
pub clippy::TEST_GROUP,
|
||||
Warn, "Warn about other stuff"
|
||||
);
|
||||
|
||||
struct Pass;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user