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 {}
986
986
pub trait PointerLike { }
987
987
988
988
/// 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`.
989
994
#[ lang = "const_param_ty" ]
990
995
#[ unstable( feature = "adt_const_params" , issue = "95174" ) ]
991
996
#[ rustc_on_unimplemented( message = "`{Self}` can't be used as a const parameter type" ) ]
992
997
#[ allow( multiple_supertrait_upcastable) ]
993
- pub trait ConstParamTy : StructuralEq + StructuralPartialEq { }
998
+ pub trait ConstParamTy : StructuralEq + StructuralPartialEq + Eq { }
994
999
995
1000
/// Derive macro generating an impl of the trait `ConstParamTy`.
996
1001
#[ rustc_builtin_macro]
You can’t perform that action at this time.
0 commit comments