+ if ty::search_for_structural_match_violation(
+ param.hir_id, param.span, tcx, ty).is_some()
+ {
+ struct_span_err!(
+ tcx.sess,
+ hir_ty.span,
+ E0741,
+ "the types of const generic parameters must derive `PartialEq` and `Eq`",
+ ).span_label(
+ hir_ty.span,
+ format!("`{}` doesn't derive both `PartialEq` and `Eq`", ty),
+ ).emit();
+ }