@@ -22,12 +22,15 @@ fn checked_log() {
2222 assert_eq ! ( 0i8 . checked_log( 4 ) , None ) ;
2323 assert_eq ! ( 0i16 . checked_log( 4 ) , None ) ;
2424
25+ #[ cfg( not( miri) ) ] // Miri is too slow
2526 for i in i16:: MIN ..=0 {
2627 assert_eq ! ( i. checked_log( 4 ) , None ) ;
2728 }
29+ #[ cfg( not( miri) ) ] // Miri is too slow
2830 for i in 1 ..=i16:: MAX {
2931 assert_eq ! ( i. checked_log( 13 ) , Some ( ( i as f32 ) . log( 13.0 ) as u32 ) ) ;
3032 }
33+ #[ cfg( not( miri) ) ] // Miri is too slow
3134 for i in 1 ..=u16:: MAX {
3235 assert_eq ! ( i. checked_log( 13 ) , Some ( ( i as f32 ) . log( 13.0 ) as u32 ) ) ;
3336 }
@@ -48,6 +51,7 @@ fn checked_log2() {
4851 for i in 1 ..=u8:: MAX {
4952 assert_eq ! ( i. checked_log2( ) , Some ( ( i as f32 ) . log2( ) as u32 ) ) ;
5053 }
54+ #[ cfg( not( miri) ) ] // Miri is too slow
5155 for i in 1 ..=u16:: MAX {
5256 // Guard against Android's imprecise f32::log2 implementation.
5357 if i != 8192 && i != 32768 {
@@ -60,9 +64,11 @@ fn checked_log2() {
6064 for i in 1 ..=i8:: MAX {
6165 assert_eq ! ( i. checked_log2( ) , Some ( ( i as f32 ) . log2( ) as u32 ) ) ;
6266 }
67+ #[ cfg( not( miri) ) ] // Miri is too slow
6368 for i in i16:: MIN ..=0 {
6469 assert_eq ! ( i. checked_log2( ) , None ) ;
6570 }
71+ #[ cfg( not( miri) ) ] // Miri is too slow
6672 for i in 1 ..=i16:: MAX {
6773 // Guard against Android's imprecise f32::log2 implementation.
6874 if i != 8192 {
@@ -87,15 +93,19 @@ fn checked_log10() {
8793 assert_eq ! ( 0i8 . checked_log10( ) , None ) ;
8894 assert_eq ! ( 0i16 . checked_log10( ) , None ) ;
8995
96+ #[ cfg( not( miri) ) ] // Miri is too slow
9097 for i in i16:: MIN ..=0 {
9198 assert_eq ! ( i. checked_log10( ) , None ) ;
9299 }
100+ #[ cfg( not( miri) ) ] // Miri is too slow
93101 for i in 1 ..=i16:: MAX {
94102 assert_eq ! ( i. checked_log10( ) , Some ( ( i as f32 ) . log10( ) as u32 ) ) ;
95103 }
104+ #[ cfg( not( miri) ) ] // Miri is too slow
96105 for i in 1 ..=u16:: MAX {
97106 assert_eq ! ( i. checked_log10( ) , Some ( ( i as f32 ) . log10( ) as u32 ) ) ;
98107 }
108+ #[ cfg( not( miri) ) ] // Miri is too slow
99109 for i in 1 ..=100_000u32 {
100110 assert_eq ! ( i. checked_log10( ) , Some ( ( i as f32 ) . log10( ) as u32 ) ) ;
101111 }
0 commit comments