12
12
fn do_match ( & self , other : & Rhs ) -> bool ;
13
13
}
14
14
15
- macro_rules ! impl_match_lowered_cmp_for_primitive {
15
+ macro_rules ! impl_for_primitive {
16
16
( $( $t: ty) , * ) => {
17
17
$(
18
18
impl const MatchLoweredCmp for $t {
@@ -24,15 +24,14 @@ macro_rules ! impl_match_lowered_cmp_for_primitive {
24
24
} ;
25
25
}
26
26
27
- impl_match_lowered_cmp_for_primitive ! {
27
+ impl_for_primitive ! {
28
28
bool , char ,
29
29
u8 , u16 , u32 , u64 , u128 , usize ,
30
30
i8 , i16 , i32 , i64 , i128 , isize ,
31
31
f32 , f64
32
32
}
33
33
34
34
impl const MatchLoweredCmp for str {
35
- #[ rustc_allow_const_fn_unstable( const_trait_impl) ]
36
35
fn do_match ( & self , other : & Self ) -> bool {
37
36
<[ u8 ] as MatchLoweredCmp >:: do_match ( ( * self ) . as_bytes ( ) , ( * other) . as_bytes ( ) )
38
37
}
@@ -42,7 +41,6 @@ impl<T> const MatchLoweredCmp for [T]
42
41
where
43
42
T : ~const MatchLoweredCmp ,
44
43
{
45
- #[ rustc_allow_const_fn_unstable( const_trait_impl) ]
46
44
default fn do_match ( & self , other : & Self ) -> bool {
47
45
if self . len ( ) != other. len ( ) {
48
46
return false ;
@@ -62,11 +60,11 @@ where
62
60
}
63
61
}
64
62
63
+ #[ rustc_const_unstable( feature = "core_intrinsics" , issue = "none" ) ]
65
64
impl < T > const MatchLoweredCmp for [ T ]
66
65
where
67
66
T : ~const MatchLoweredCmp + BytewiseEq < T > ,
68
67
{
69
- #[ rustc_allow_const_fn_unstable( core_intrinsics, const_trait_impl) ]
70
68
fn do_match ( & self , other : & Self ) -> bool {
71
69
if self . len ( ) != other. len ( ) {
72
70
return false ;
0 commit comments