- ExprKind::Call(ref func, _) => {
- if let ExprKind::Path(ref cond_num_path) = func.kind {
- if INT_TYPES.iter().any(|int_type| match_qpath(cond_num_path, &[int_type, "min_value"])) {
- print_lint_and_sugg(cx, &var_name, expr);
+ ExprKind::Call(func, []) => {
+ if_chain! {
+ if let ExprKind::Path(QPath::TypeRelative(_, name)) = func.kind;
+ if name.ident.as_str() == "min_value";
+ if let Some(func_id) = cx.typeck_results().type_dependent_def_id(func.hir_id);
+ if let Some(impl_id) = cx.tcx.impl_of_method(func_id);
+ let mut int_ids = INT_TYPES.iter().filter_map(|&ty| cx.tcx.lang_items().require(ty).ok());
+ if int_ids.any(|int_id| int_id == impl_id);
+ then {
+ print_lint_and_sugg(cx, &var_name, expr)