From 1ccc872cd13f3ffa8b8b9763e94dac4e887b0182 Mon Sep 17 00:00:00 2001 From: rex remind Date: Mon, 19 Dec 2022 10:02:11 -0800 Subject: [PATCH] [fix-ci-nightly] include Float / FloatCore for non-std builds for float_sampler --- proptest/Cargo.toml | 4 +++- proptest/src/num/float_samplers.rs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/proptest/Cargo.toml b/proptest/Cargo.toml index 661d33f5..26ca62e3 100644 --- a/proptest/Cargo.toml +++ b/proptest/Cargo.toml @@ -68,8 +68,10 @@ version = "1.2" optional = true [dependencies.num-traits] -version = "0.2.2" +version = "0.2.15" default-features = false +# std or libm required for mul_add. +features = ["libm"] [dependencies.quick-error] version = "2.0.0" diff --git a/proptest/src/num/float_samplers.rs b/proptest/src/num/float_samplers.rs index cd3ca211..69fd5c5d 100644 --- a/proptest/src/num/float_samplers.rs +++ b/proptest/src/num/float_samplers.rs @@ -21,6 +21,8 @@ macro_rules! float_sampler { use rand::distributions::uniform::{ SampleBorrow, SampleUniform, Uniform, UniformSampler, }; + #[cfg(not(feature = "std"))] + use num_traits::float::Float; #[must_use] // Returns the previous float value. In other words the greatest value representable