use clippy_utils::diagnostics::span_lint_and_help;
-use clippy_utils::in_macro;
use rustc_ast::ast::{AssocItemKind, Extern, Fn, FnSig, Impl, Item, ItemKind, Trait, Ty, TyKind};
use rustc_lint::{EarlyContext, EarlyLintPass};
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::{sym, Span};
-use std::convert::TryInto;
-
declare_clippy_lint! {
/// ### What it does
/// Checks for excessive
/// Finished,
/// }
/// ```
+ #[clippy::version = "1.43.0"]
pub STRUCT_EXCESSIVE_BOOLS,
pedantic,
"using too many bools in a struct"
///
/// fn f(shape: Shape, temperature: Temperature) { ... }
/// ```
+ #[clippy::version = "1.43.0"]
pub FN_PARAMS_EXCESSIVE_BOOLS,
pedantic,
"using too many bools in function parameters"
impl EarlyLintPass for ExcessiveBools {
fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
- if in_macro(item.span) {
+ if item.span.from_expansion() {
return;
}
match &item.kind {