]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/excessive_bools.rs
Merge commit '4911ab124c481430672a3833b37075e6435ec34d' into clippyup
[rust.git] / clippy_lints / src / excessive_bools.rs
index aa91ab3bc774c997e9a3b1a98b0d2dcc669f74e7..82ca4baacb7a9763cd390532f369c36a88924941 100644 (file)
@@ -1,8 +1,8 @@
 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_lint::{EarlyContext, EarlyLintPass};
 use rustc_session::{declare_tool_lint, impl_lint_pass};
 use rustc_span::Span;
-use syntax::ast::{AssocItemKind, Extern, FnSig, Item, ItemKind, Ty, TyKind};
 
 use std::convert::TryInto;
 
@@ -114,6 +114,7 @@ fn check_fn_sig(&self, cx: &EarlyContext<'_>, fn_sig: &FnSig, 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",
             );
         }
@@ -153,6 +154,7 @@ fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
                         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",
                     );
                 }
@@ -162,12 +164,12 @@ fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
             }
             | ItemKind::Trait(_, _, _, _, items) => {
                 for item in items {
-                    if let AssocItemKind::Fn(fn_sig, _, _) = &item.kind {
+                    if let AssocItemKind::Fn(_, 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(_, fn_sig, _, _) => self.check_fn_sig(cx, fn_sig, item.span),
             _ => (),
         }
     }