@@ -205,6 +205,20 @@ pub trait StructuralPartialEq {
205205 // Empty.
206206}
207207
208+ marker_impls ! {
209+ #[ unstable( feature = "structural_match" , issue = "31434" ) ]
210+ StructuralPartialEq for
211+ usize , u8 , u16 , u32 , u64 , u128 ,
212+ isize , i8 , i16 , i32 , i64 , i128 ,
213+ bool ,
214+ char ,
215+ str /* Technically requires `[u8]: StructuralEq` */ ,
216+ ( ) ,
217+ { T , const N : usize } [ T ; N ] ,
218+ { T } [ T ] ,
219+ { T : ?Sized } & T ,
220+ }
221+
208222/// Required trait for constants used in pattern matches.
209223///
210224/// Any type that derives `Eq` automatically implements this trait, *regardless*
@@ -267,6 +281,7 @@ marker_impls! {
267281 bool ,
268282 char ,
269283 str /* Technically requires `[u8]: StructuralEq` */ ,
284+ ( ) ,
270285 { T , const N : usize } [ T ; N ] ,
271286 { T } [ T ] ,
272287 { T : ?Sized } & T ,
@@ -974,7 +989,8 @@ pub trait PointerLike {}
974989#[ lang = "const_param_ty" ]
975990#[ unstable( feature = "adt_const_params" , issue = "95174" ) ]
976991#[ rustc_on_unimplemented( message = "`{Self}` can't be used as a const parameter type" ) ]
977- pub trait ConstParamTy : StructuralEq { }
992+ #[ allow( multiple_supertrait_upcastable) ]
993+ pub trait ConstParamTy : StructuralEq + StructuralPartialEq { }
978994
979995/// Derive macro generating an impl of the trait `ConstParamTy`.
980996#[ rustc_builtin_macro]
@@ -983,8 +999,7 @@ pub macro ConstParamTy($item:item) {
983999 /* compiler built-in */
9841000}
9851001
986- // FIXME(generic_const_parameter_types): handle `ty::FnDef`/`ty::Closure`
987- // FIXME(generic_const_parameter_types): handle `ty::Tuple`
1002+ // FIXME(adt_const_params): handle `ty::FnDef`/`ty::Closure`
9881003marker_impls ! {
9891004 #[ unstable( feature = "adt_const_params" , issue = "95174" ) ]
9901005 ConstParamTy for
@@ -998,6 +1013,11 @@ marker_impls! {
9981013 { T : ?Sized + ConstParamTy } & T ,
9991014}
10001015
1016+ // FIXME(adt_const_params): Add to marker_impls call above once not in bootstrap
1017+ #[ unstable( feature = "adt_const_params" , issue = "95174" ) ]
1018+ #[ cfg( not( bootstrap) ) ]
1019+ impl ConstParamTy for ( ) { }
1020+
10011021/// A common trait implemented by all function pointers.
10021022#[ unstable(
10031023 feature = "fn_ptr_trait" ,
0 commit comments