@@ -24,15 +24,15 @@ fn checked_ilog() {
24
24
25
25
#[ cfg( not( miri) ) ] // Miri is too slow
26
26
for i in i16:: MIN ..=0 {
27
- assert_eq ! ( i. checked_ilog( 4 ) , None ) ;
27
+ assert_eq ! ( i. checked_ilog( 4 ) , None , "checking {i}" ) ;
28
28
}
29
29
#[ cfg( not( miri) ) ] // Miri is too slow
30
30
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}" ) ;
32
32
}
33
33
#[ cfg( not( miri) ) ] // Miri is too slow
34
34
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}" ) ;
36
36
}
37
37
}
38
38
@@ -49,30 +49,30 @@ fn checked_ilog2() {
49
49
assert_eq ! ( 0i16 . checked_ilog2( ) , None ) ;
50
50
51
51
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}" ) ;
53
53
}
54
54
#[ cfg( not( miri) ) ] // Miri is too slow
55
55
for i in 1 ..=u16:: MAX {
56
56
// Guard against Android's imprecise f32::ilog2 implementation.
57
57
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}" ) ;
59
59
}
60
60
}
61
61
for i in i8:: MIN ..=0 {
62
- assert_eq ! ( i. checked_ilog2( ) , None ) ;
62
+ assert_eq ! ( i. checked_ilog2( ) , None , "checking {i}" ) ;
63
63
}
64
64
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}" ) ;
66
66
}
67
67
#[ cfg( not( miri) ) ] // Miri is too slow
68
68
for i in i16:: MIN ..=0 {
69
- assert_eq ! ( i. checked_ilog2( ) , None ) ;
69
+ assert_eq ! ( i. checked_ilog2( ) , None , "checking {i}" ) ;
70
70
}
71
71
#[ cfg( not( miri) ) ] // Miri is too slow
72
72
for i in 1 ..=i16:: MAX {
73
73
// Guard against Android's imprecise f32::ilog2 implementation.
74
74
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}" ) ;
76
76
}
77
77
}
78
78
}
@@ -95,19 +95,19 @@ fn checked_ilog10() {
95
95
96
96
#[ cfg( not( miri) ) ] // Miri is too slow
97
97
for i in i16:: MIN ..=0 {
98
- assert_eq ! ( i. checked_ilog10( ) , None ) ;
98
+ assert_eq ! ( i. checked_ilog10( ) , None , "checking {i}" ) ;
99
99
}
100
100
#[ cfg( not( miri) ) ] // Miri is too slow
101
101
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}" ) ;
103
103
}
104
104
#[ cfg( not( miri) ) ] // Miri is too slow
105
105
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}" ) ;
107
107
}
108
108
#[ cfg( not( miri) ) ] // Miri is too slow
109
109
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}" ) ;
111
111
}
112
112
}
113
113
0 commit comments