Closed nbraud closed 3 years ago
PS: My actual issue was caused by a mismatch in rand
versions, so that's fixed, but it seems worth improving the documentation anyhow.
Thanks, I think you just saved me a bunch of time with this post :pray: :slightly_smiling_face: :crab: :rocket:
I'd like to report what is probably a documentation issue: when trying to implement
Arbitrary
for a custom datatype (one that models integer factorisations), I quickly discovered that thequickcheck
documentation does not explain how to (usefully) implement it, and in particular how to do anything with aquickcheck::Gen
.My implementation is:
The build output is:
Confusingly, the documentation for
quickcheck::Gen
states it is aquickcheck::RngCore
, whose own documentation states that “End users should normally use the Rng trait from the rand crate”... when end users cannot possibly implement traits likeArbitrary
without interacting withGen
andRngCore
. Even simply discovering thegen_range
method required me to look at quickcheck's own implementations ofArbitrary
.