From f022087443de44225fb85554c585c2d200ec0575 Mon Sep 17 00:00:00 2001 From: Joey Beauvais-Feisthauer Date: Thu, 22 Aug 2024 15:38:46 -0400 Subject: [PATCH] Add explanation for `Arbitrary` on static primes --- ext/crates/fp/src/prime/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/crates/fp/src/prime/mod.rs b/ext/crates/fp/src/prime/mod.rs index 3394f3f07..9f6c809f6 100644 --- a/ext/crates/fp/src/prime/mod.rs +++ b/ext/crates/fp/src/prime/mod.rs @@ -170,7 +170,9 @@ macro_rules! def_prime_static { fn arbitrary_with(_max: Self::Parameters) -> Self::Strategy { // This doesn't honor the max parameter, but that should be fine as long as the - // static primes are small enough and/or the max is large enough. + // static primes are small enough and/or the max is large enough. There's no such + // thing as an empty strategy, so the best we could do is return a strategy that + // always rejects. This would cause local failures that may make tests fail. proptest::strategy::Just($pn) } }