@@ -1078,58 +1078,41 @@ pub trait Tuple {}
1078
1078
/// that all fields are also `ConstParamTy`, which implies that recursively, all fields
1079
1079
/// are `StructuralPartialEq`.
1080
1080
#[ lang = "const_param_ty" ]
1081
- #[ unstable( feature = "unsized_const_params" , issue = "95174" ) ]
1082
1081
#[ diagnostic:: on_unimplemented( message = "`{Self}` can't be used as a const parameter type" ) ]
1083
1082
#[ allow( multiple_supertrait_upcastable) ]
1084
1083
// We name this differently than the derive macro so that the `adt_const_params` can
1085
1084
// be used independently of `unsized_const_params` without requiring a full path
1086
1085
// to the derive macro every time it is used. This should be renamed on stabilization.
1087
- pub trait ConstParamTy_ : StructuralPartialEq + Eq { }
1086
+ pub trait ConstParamTy : StructuralPartialEq + Eq { }
1088
1087
1089
1088
/// Derive macro generating an impl of the trait `ConstParamTy`.
1090
1089
#[ rustc_builtin_macro]
1091
- #[ allow_internal_unstable( unsized_const_params) ]
1090
+ #[ allow_internal_unstable( unsized_const_params) ] // todo: remove this?
1092
1091
#[ unstable( feature = "adt_const_params" , issue = "95174" ) ]
1093
1092
pub macro ConstParamTy ( $item: item) {
1094
1093
/* compiler built-in */
1095
1094
}
1096
1095
1097
- #[ lang = "unsized_const_param_ty" ]
1098
- #[ unstable( feature = "unsized_const_params" , issue = "95174" ) ]
1099
- #[ diagnostic:: on_unimplemented( message = "`{Self}` can't be used as a const parameter type" ) ]
1100
- /// A marker for types which can be used as types of `const` generic parameters.
1101
- ///
1102
- /// Equivalent to [`ConstParamTy_`] except that this is used by
1103
- /// the `unsized_const_params` to allow for fake unstable impls.
1104
- pub trait UnsizedConstParamTy : StructuralPartialEq + Eq { }
1105
-
1106
- /// Derive macro generating an impl of the trait `ConstParamTy`.
1107
- #[ rustc_builtin_macro]
1108
- #[ allow_internal_unstable( unsized_const_params) ]
1109
- #[ unstable( feature = "unsized_const_params" , issue = "95174" ) ]
1110
- pub macro UnsizedConstParamTy ( $item: item) {
1111
- /* compiler built-in */
1112
- }
1113
-
1114
1096
// FIXME(adt_const_params): handle `ty::FnDef`/`ty::Closure`
1115
1097
marker_impls ! {
1116
1098
#[ unstable( feature = "adt_const_params" , issue = "95174" ) ]
1117
- ConstParamTy_ for
1099
+ #[ unstable_feature_bound( adt_const_params) ]
1100
+ ConstParamTy for
1118
1101
usize , u8 , u16 , u32 , u64 , u128 ,
1119
1102
isize , i8 , i16 , i32 , i64 , i128 ,
1120
1103
bool ,
1121
1104
char ,
1122
1105
( ) ,
1123
- { T : ConstParamTy_ , const N : usize } [ T ; N ] ,
1106
+ { T : ConstParamTy , const N : usize } [ T ; N ] ,
1124
1107
}
1125
1108
1126
1109
marker_impls ! {
1127
1110
#[ unstable( feature = "unsized_const_params" , issue = "95174" ) ]
1128
1111
#[ unstable_feature_bound( unsized_const_params) ]
1129
- ConstParamTy_ for
1112
+ ConstParamTy for
1130
1113
str ,
1131
- { T : ConstParamTy_ } [ T ] ,
1132
- { T : ConstParamTy_ + ?Sized } & T ,
1114
+ { T : ConstParamTy } [ T ] ,
1115
+ { T : ConstParamTy + ?Sized } & T ,
1133
1116
}
1134
1117
1135
1118
/// A common trait implemented by all function pointers.
0 commit comments