@@ -24,15 +24,15 @@ fn checked_ilog() {
2424
2525 #[ cfg( not( miri) ) ] // Miri is too slow
2626 for i in i16:: MIN ..=0 {
27- assert_eq ! ( i. checked_ilog( 4 ) , None ) ;
27+ assert_eq ! ( i. checked_ilog( 4 ) , None , "checking {i}" ) ;
2828 }
2929 #[ cfg( not( miri) ) ] // Miri is too slow
3030 for i in 1 ..=i16:: MAX {
31- assert_eq ! ( i. checked_ilog( 13 ) , Some ( ( i as f32 ) . log( 13.0 ) as u32 ) ) ;
31+ assert_eq ! ( i. checked_ilog( 13 ) , Some ( ( i as f32 ) . log( 13.0 ) as u32 ) , "checking {i}" ) ;
3232 }
3333 #[ cfg( not( miri) ) ] // Miri is too slow
3434 for i in 1 ..=u16:: MAX {
35- assert_eq ! ( i. checked_ilog( 13 ) , Some ( ( i as f32 ) . log( 13.0 ) as u32 ) ) ;
35+ assert_eq ! ( i. checked_ilog( 13 ) , Some ( ( i as f32 ) . log( 13.0 ) as u32 ) , "checking {i}" ) ;
3636 }
3737}
3838
@@ -49,30 +49,30 @@ fn checked_ilog2() {
4949 assert_eq ! ( 0i16 . checked_ilog2( ) , None ) ;
5050
5151 for i in 1 ..=u8:: MAX {
52- assert_eq ! ( i. checked_ilog2( ) , Some ( ( i as f32 ) . log2( ) as u32 ) ) ;
52+ assert_eq ! ( i. checked_ilog2( ) , Some ( ( i as f32 ) . log2( ) as u32 ) , "checking {i}" ) ;
5353 }
5454 #[ cfg( not( miri) ) ] // Miri is too slow
5555 for i in 1 ..=u16:: MAX {
5656 // Guard against Android's imprecise f32::ilog2 implementation.
5757 if i != 8192 && i != 32768 {
58- assert_eq ! ( i. checked_ilog2( ) , Some ( ( i as f32 ) . log2( ) as u32 ) ) ;
58+ assert_eq ! ( i. checked_ilog2( ) , Some ( ( i as f32 ) . log2( ) as u32 ) , "checking {i}" ) ;
5959 }
6060 }
6161 for i in i8:: MIN ..=0 {
62- assert_eq ! ( i. checked_ilog2( ) , None ) ;
62+ assert_eq ! ( i. checked_ilog2( ) , None , "checking {i}" ) ;
6363 }
6464 for i in 1 ..=i8:: MAX {
65- assert_eq ! ( i. checked_ilog2( ) , Some ( ( i as f32 ) . log2( ) as u32 ) ) ;
65+ assert_eq ! ( i. checked_ilog2( ) , Some ( ( i as f32 ) . log2( ) as u32 ) , "checking {i}" ) ;
6666 }
6767 #[ cfg( not( miri) ) ] // Miri is too slow
6868 for i in i16:: MIN ..=0 {
69- assert_eq ! ( i. checked_ilog2( ) , None ) ;
69+ assert_eq ! ( i. checked_ilog2( ) , None , "checking {i}" ) ;
7070 }
7171 #[ cfg( not( miri) ) ] // Miri is too slow
7272 for i in 1 ..=i16:: MAX {
7373 // Guard against Android's imprecise f32::ilog2 implementation.
7474 if i != 8192 {
75- assert_eq ! ( i. checked_ilog2( ) , Some ( ( i as f32 ) . log2( ) as u32 ) ) ;
75+ assert_eq ! ( i. checked_ilog2( ) , Some ( ( i as f32 ) . log2( ) as u32 ) , "checking {i}" ) ;
7676 }
7777 }
7878}
@@ -95,19 +95,19 @@ fn checked_ilog10() {
9595
9696 #[ cfg( not( miri) ) ] // Miri is too slow
9797 for i in i16:: MIN ..=0 {
98- assert_eq ! ( i. checked_ilog10( ) , None ) ;
98+ assert_eq ! ( i. checked_ilog10( ) , None , "checking {i}" ) ;
9999 }
100100 #[ cfg( not( miri) ) ] // Miri is too slow
101101 for i in 1 ..=i16:: MAX {
102- assert_eq ! ( i. checked_ilog10( ) , Some ( ( i as f32 ) . log10( ) as u32 ) ) ;
102+ assert_eq ! ( i. checked_ilog10( ) , Some ( ( i as f32 ) . log10( ) as u32 ) , "checking {i}" ) ;
103103 }
104104 #[ cfg( not( miri) ) ] // Miri is too slow
105105 for i in 1 ..=u16:: MAX {
106- assert_eq ! ( i. checked_ilog10( ) , Some ( ( i as f32 ) . log10( ) as u32 ) ) ;
106+ assert_eq ! ( i. checked_ilog10( ) , Some ( ( i as f32 ) . log10( ) as u32 ) , "checking {i}" ) ;
107107 }
108108 #[ cfg( not( miri) ) ] // Miri is too slow
109109 for i in 1 ..=100_000u32 {
110- assert_eq ! ( i. checked_ilog10( ) , Some ( ( i as f32 ) . log10( ) as u32 ) ) ;
110+ assert_eq ! ( i. checked_ilog10( ) , Some ( ( i as f32 ) . log10( ) as u32 ) , "checking {i}" ) ;
111111 }
112112}
113113
0 commit comments