1212 fn do_match ( & self , other : & Rhs ) -> bool ;
1313}
1414
15- macro_rules ! impl_match_lowered_cmp_for_primitive {
15+ macro_rules ! impl_for_primitive {
1616 ( $( $t: ty) , * ) => {
1717 $(
1818 impl const MatchLoweredCmp for $t {
@@ -24,15 +24,14 @@ macro_rules ! impl_match_lowered_cmp_for_primitive {
2424 } ;
2525}
2626
27- impl_match_lowered_cmp_for_primitive ! {
27+ impl_for_primitive ! {
2828 bool , char ,
2929 u8 , u16 , u32 , u64 , u128 , usize ,
3030 i8 , i16 , i32 , i64 , i128 , isize ,
3131 f32 , f64
3232}
3333
3434impl const MatchLoweredCmp for str {
35- #[ rustc_allow_const_fn_unstable( const_trait_impl) ]
3635 fn do_match ( & self , other : & Self ) -> bool {
3736 <[ u8 ] as MatchLoweredCmp >:: do_match ( ( * self ) . as_bytes ( ) , ( * other) . as_bytes ( ) )
3837 }
@@ -42,7 +41,6 @@ impl<T> const MatchLoweredCmp for [T]
4241where
4342 T : ~const MatchLoweredCmp ,
4443{
45- #[ rustc_allow_const_fn_unstable( const_trait_impl) ]
4644 default fn do_match ( & self , other : & Self ) -> bool {
4745 if self . len ( ) != other. len ( ) {
4846 return false ;
@@ -62,11 +60,11 @@ where
6260 }
6361}
6462
63+ #[ rustc_const_unstable( feature = "core_intrinsics" , issue = "none" ) ]
6564impl < T > const MatchLoweredCmp for [ T ]
6665where
6766 T : ~const MatchLoweredCmp + BytewiseEq < T > ,
6867{
69- #[ rustc_allow_const_fn_unstable( core_intrinsics, const_trait_impl) ]
7068 fn do_match ( & self , other : & Self ) -> bool {
7169 if self . len ( ) != other. len ( ) {
7270 return false ;
0 commit comments