declare_clippy_lint! {
/// ### What it does
- /// Checks for deriving `Hash` but implementing `PartialEq`
- /// explicitly or vice versa.
+ /// Lints against manual `PartialEq` implementations for types with a derived `Hash`
+ /// implementation.
///
/// ### Why is this bad?
/// The implementation of these traits must agree (for
declare_clippy_lint! {
/// ### What it does
- /// Checks for deriving `Ord` but implementing `PartialOrd`
- /// explicitly or vice versa.
+ /// Lints against manual `PartialOrd` and `Ord` implementations for types with a derived `Ord`
+ /// or `PartialOrd` implementation.
///
/// ### Why is this bad?
/// The implementation of these traits must agree (for
}) = item.kind
{
let ty = cx.tcx.type_of(item.owner_id).subst_identity();
- let is_automatically_derived = cx.tcx.has_attr(item.owner_id.to_def_id(), sym::automatically_derived);
+ let is_automatically_derived = cx.tcx.has_attr(item.owner_id, sym::automatically_derived);
check_hash_peq(cx, item.span, trait_ref, ty, is_automatically_derived);
check_ord_partial_ord(cx, item.span, trait_ref, ty, is_automatically_derived);