Function rustc_ty_utils::structural_match::has_structural_eq_impls
source · fn has_structural_eq_impls<'tcx>(tcx: TyCtxt<'tcx>, adt_ty: Ty<'tcx>) -> bool
Expand description
This method returns true if and only if adt_ty
itself has been marked as
eligible for structural-match: namely, if it implements both
StructuralPartialEq
and StructuralEq
(which are respectively injected by
#[derive(PartialEq)]
and #[derive(Eq)]
).
Note that this does not recursively check if the substructure of adt_ty
implements the traits.