Skip to content

Commit 6a958db

Browse files
committed
[fix-ci-nigtly] ci was broken on nightly the series of fixes should correct it
* dependencies.x86 was bumped to latest current version. x86 crate does not advertise an MSRV, but this was just broken on even our MSRV because the old x86 version was using a macro removed from rust, so bumping to latest seems fair. * the calculation for the arbitrary impl of Layout was using a max_size that was too large and overflowing Layout. this has been fixed. * test for arbitrary AllocError was referring to AllocErr which does not exist, this was fixed. * NoneError has been removed from rust so it was subsequently removed from proptest. It was blocking compilation. evidence: rust-lang/rust#85614 * try_reserve is stable so removed from unstable features * try_trait has been changed to try_trait_v2 so that was fixed in Cargo.toml.
1 parent a077ade commit 6a958db

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed

proptest/CHANGELOG.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@
44

55
- Sampling from large ranges of floats such as `(0f32)..` no longer panics
66
with newer versions of the `rand` crate
7+
- [dependencies.x86] was bumped to latest current version. x86 crate does
8+
was on a very old version 0.33.0 which used a removed macro from rust.
9+
- The calculation for the arbitrary impl of Layout was using a max_size that
10+
was too large and overflowing Layout. This has been fixed.
11+
- Test for arbitrary AllocError was referring to AllocErr which
12+
does not exist, this was fixed.
13+
- NoneError has been removed from rust so it was subsequently
14+
removed from proptest. It was blocking compilation. evidence:
15+
https://github.com/rust-lang/rust/issues/85614
16+
- `try_reserve` is stable so removed from unstable features
17+
- `try_trait` has been changed to `try_trait_v2` so that was adjusted
18+
in `Cargo.toml`.
719

820
### New Features
921

@@ -641,7 +653,7 @@ features.
641653
These are "higher order" `Arbitrary` traits that correspond to the `Arbitrary1`
642654
and `Arbitrary2` type classes in Haskell's QuickCheck. They are mainly provided
643655
to support a common set of container-like types in custom deriving self-recursive
644-
types in `proptest_derive`. More on this later releases.
656+
types in `proptest_derive`. More on this later releases.
645657

646658
- The strategies in `proptest::option` and `proptest::result` now accept a type
647659
`Probability` which is a wrapper around `f64`. Conversions from types such as

proptest/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ version = "3.0"
113113
optional = true
114114

115115
[dependencies.x86]
116-
version = "0.33.0"
116+
version = "0.52.0"
117117
optional = true
118118

119119
[dev-dependencies]

proptest/src/arbitrary/_alloc/alloc.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ arbitrary!(self::alloc::Layout, SFnPtrMap<(Range<u8>, StrategyFor<usize>), Self>
2929
// 2. "when rounded up to the nearest multiple of align, must not overflow".
3030
static_map((0u8..32u8, any::<usize>()), |(align_power, size)| {
3131
let align = 1usize << align_power;
32-
let max_size = 0usize.wrapping_sub(align);
32+
// TODO: This may only work on 64 bit processors, but previously it was broken
33+
// even on 64 bit so still an improvement. 63 -> uint size - 1.
34+
let max_size = (1usize << 63) - (1 << usize::from(align_power));
3335
// Not quite a uniform distribution due to clamping,
3436
// but probably good enough
3537
self::alloc::Layout::from_size_align(cmp::min(max_size, size), align).unwrap()
@@ -51,7 +53,7 @@ mod test {
5153

5254
no_panic_test!(
5355
layout => self::alloc::Layout,
54-
alloc_err => self::alloc::AllocErr
56+
alloc_err => self::alloc::AllocError
5557
//collection_alloc_err => alloc::collections::CollectionAllocErr
5658
);
5759
}

proptest/src/arbitrary/_core/option.rs

-3
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ lift1!(['static] opt::IntoIter<A>, Probability;
4646
base, prob => weighted(prob, base).prop_map(Option::into_iter)
4747
);
4848

49-
#[cfg(feature = "unstable")]
50-
arbitrary!(opt::NoneError; opt::NoneError);
51-
5249
#[cfg(test)]
5350
mod test {
5451
no_panic_test!(

proptest/src/lib.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@
2626
feature = "unstable",
2727
feature(
2828
allocator_api,
29-
try_trait,
29+
try_trait_v2,
3030
generator_trait,
31-
never_type,
32-
try_reserve
31+
never_type
3332
)
3433
)]
3534
#![cfg_attr(all(feature = "std", feature = "unstable"), feature(ip))]

0 commit comments

Comments
 (0)