From d501226aeb71bf104432c9228e69858936a6436b Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Thu, 1 Sep 2022 16:24:54 +0100 Subject: [PATCH] [proptest] Enable i128 and u128 on Wasm --- book/src/proptest/wasm.md | 2 -- proptest/src/arbitrary/primitives.rs | 9 ++------- proptest/src/num.rs | 2 -- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/book/src/proptest/wasm.md b/book/src/proptest/wasm.md index c38ad911..d31e92df 100644 --- a/book/src/proptest/wasm.md +++ b/book/src/proptest/wasm.md @@ -19,6 +19,4 @@ features = ["std"] A few APIs are unavailable on `wasm` targets (beyond those which are removed by deselecting certain default features): -- Numeric strategies for `i128` and `u128`. - - The `Arbitrary` implementation for `std::env::VarError`. diff --git a/proptest/src/arbitrary/primitives.rs b/proptest/src/arbitrary/primitives.rs index cea57f4c..3f6e0bf1 100644 --- a/proptest/src/arbitrary/primitives.rs +++ b/proptest/src/arbitrary/primitives.rs @@ -12,15 +12,10 @@ use crate::bool; use crate::char; use crate::num::{ - f32, f64, i16, i32, i64, i8, isize, u16, u32, u64, u8, usize, + f32, f64, i128, i16, i32, i64, i8, isize, u128, u16, u32, u64, u8, usize, }; -#[cfg(not(target_arch = "wasm32"))] -use crate::num::{i128, u128}; -arbitrary!(bool, i8, i16, i32, i64, isize, u8, u16, u32, u64, usize); - -#[cfg(not(target_arch = "wasm32"))] -arbitrary!(i128, u128); +arbitrary!(bool, i8, i16, i32, i64, isize, u8, u16, u32, u64, usize, i128, u128); // Note that for floating point types we limit the space since a lot of code // isn't prepared for (and is not intended to be) things like NaN and infinity. diff --git a/proptest/src/num.rs b/proptest/src/num.rs index 675cb59f..e30ba859 100644 --- a/proptest/src/num.rs +++ b/proptest/src/num.rs @@ -365,14 +365,12 @@ signed_integer_bin_search!(i8); signed_integer_bin_search!(i16); signed_integer_bin_search!(i32); signed_integer_bin_search!(i64); -#[cfg(not(target_arch = "wasm32"))] signed_integer_bin_search!(i128); signed_integer_bin_search!(isize); unsigned_integer_bin_search!(u8); unsigned_integer_bin_search!(u16); unsigned_integer_bin_search!(u32); unsigned_integer_bin_search!(u64); -#[cfg(not(target_arch = "wasm32"))] unsigned_integer_bin_search!(u128); unsigned_integer_bin_search!(usize);