File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ use safety::{ensures, requires};
44#[ cfg( kani) ]
55use crate :: kani;
66
7+ #[ allow( unused_imports) ]
8+ use crate :: ub_checks:: float_to_int_in_range;
9+
710mod private {
811 /// This trait being unreachable from outside the crate
912 /// prevents other implementations of the `FloatToInt` trait,
@@ -31,11 +34,8 @@ macro_rules! impl_float_to_int {
3134 #[ inline]
3235 #[ requires(
3336 !self . is_nan( ) &&
34- !self . is_infinite( ) &&
35- // Even if <$Int>::MIN < <$Float>::MIN or <$Int>::MAX > <$Float>::MAX,
36- // the bounds would be -Inf or Inf, so they'll work anyways
37- self > <$Int>:: MIN as $Float - 1.0 &&
38- self < <$Int>:: MAX as $Float + 1.0
37+ self . is_finite( ) &&
38+ float_to_int_in_range:: <$Float, $Int>( self )
3939 ) ]
4040 #[ ensures( |& result|{
4141 let fract = self - result as $Float;
You can’t perform that action at this time.
0 commit comments