File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -986,11 +986,16 @@ pub trait Tuple {}
986986pub trait PointerLike { }
987987
988988/// A marker for types which can be used as types of `const` generic parameters.
989+ ///
990+ /// These types must have a proper equivalence relation (`Eq`) and it must be automatically
991+ /// derived (`StructuralPartialEq`). There's a hard-coded check in the compiler ensuring
992+ /// that all fields are also `ConstParamTy`, which implies that recursively, all fields
993+ /// are `StructuralPartialEq`.
989994#[ lang = "const_param_ty" ]
990995#[ unstable( feature = "adt_const_params" , issue = "95174" ) ]
991996#[ rustc_on_unimplemented( message = "`{Self}` can't be used as a const parameter type" ) ]
992997#[ allow( multiple_supertrait_upcastable) ]
993- pub trait ConstParamTy : StructuralEq + StructuralPartialEq { }
998+ pub trait ConstParamTy : StructuralEq + StructuralPartialEq + Eq { }
994999
9951000/// Derive macro generating an impl of the trait `ConstParamTy`.
9961001#[ rustc_builtin_macro]
You can’t perform that action at this time.
0 commit comments