File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -824,7 +824,9 @@ macro_rules! signed_shrinker {
824
824
impl Iterator for SignedShrinker {
825
825
type Item = $ty;
826
826
fn next( & mut self ) -> Option <$ty> {
827
- if ( self . x - self . i) . abs( ) < self . x. abs( ) {
827
+ if self . x == <$ty>:: MIN
828
+ || ( self . x - self . i) . abs( ) < self . x. abs( )
829
+ {
828
830
let result = Some ( self . x - self . i) ;
829
831
self . i = self . i / 2 ;
830
832
result
Original file line number Diff line number Diff line change @@ -443,7 +443,7 @@ mod test {
443
443
#[ test]
444
444
fn regression_signed_shrinker_panic ( ) {
445
445
fn foo_can_shrink ( v : i8 ) -> bool {
446
- let _ = crate :: Arbitrary :: shrink ( & v) ;
446
+ let _ = crate :: Arbitrary :: shrink ( & v) . take ( 100 ) . count ( ) ;
447
447
true
448
448
}
449
449
crate :: quickcheck ( foo_can_shrink as fn ( i8 ) -> bool ) ;
You can’t perform that action at this time.
0 commit comments