Skip to content

Commit

Permalink
[proptest] Enable i128 and u128 on Wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
RReverser authored and matthew-russo committed Sep 22, 2024
1 parent ee4d883 commit a105c7a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
2 changes: 0 additions & 2 deletions book/src/proptest/wasm.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
9 changes: 2 additions & 7 deletions proptest/src/arbitrary/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions proptest/src/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit a105c7a

Please sign in to comment.