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;
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::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),
_ => (),
}
}