]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/collect/type_of.rs
Make the `structural_match` error diagnostic for const generics clearer
[rust.git] / src / librustc_typeck / collect / type_of.rs
index e17b736058f0267d9bf1f276181b323944fd05b7..ddf0b247ae3a39ca10ca3d4cfb938dfccc136c9d 100644 (file)
@@ -346,7 +346,9 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
                         tcx.sess,
                         hir_ty.span,
                         E0741,
-                        "the types of const generic parameters must derive `PartialEq` and `Eq`",
+                        "`{}` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the \
+                         type of a const parameter",
+                        ty,
                     )
                     .span_label(
                         hir_ty.span,