use crate::utils::{attr_by_name, in_macro, match_path_ast, span_lint_and_help};
-use rustc_ast::ast::{AssocItemKind, Extern, FnSig, Item, ItemKind, Ty, TyKind};
+use rustc_ast::ast::{
+ AssocItemKind, Extern, FnKind, FnSig, ImplKind, Item, ItemKind, TraitKind, Ty, TyKind,
+};
use rustc_lint::{EarlyContext, EarlyLintPass};
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::Span;
FN_PARAMS_EXCESSIVE_BOOLS,
span,
&format!("more than {} bools in function parameters", self.max_fn_params_bools),
+ None,
"consider refactoring bools into two-variant enums",
);
}
STRUCT_EXCESSIVE_BOOLS,
item.span,
&format!("more than {} bools in a struct", self.max_struct_bools),
+ None,
"consider using a state machine or refactoring bools into two-variant enums",
);
}
},
- ItemKind::Impl {
+ ItemKind::Impl(box ImplKind {
of_trait: None, items, ..
- }
- | ItemKind::Trait(_, _, _, _, items) => {
+ })
+ | ItemKind::Trait(box TraitKind(.., items)) => {
for item in items {
- if let AssocItemKind::Fn(_, fn_sig, _, _) = &item.kind {
+ if let AssocItemKind::Fn(box FnKind(_, fn_sig, _, _)) = &item.kind {
self.check_fn_sig(cx, fn_sig, item.span);
}
}
},
- ItemKind::Fn(_, fn_sig, _, _) => self.check_fn_sig(cx, fn_sig, item.span),
+ ItemKind::Fn(box FnKind(_, fn_sig, _, _)) => self.check_fn_sig(cx, fn_sig, item.span),
_ => (),
}
}