This enforces "no RowVars in a Type" via Rust, rather than via our checks - we have TypeBase<NoRV> or TypeBase<RowVariable>, with NoRV an empty enum.
There's a bunch more boilerplate (trivial function definitions for NoRV + RowVariable), so overall it's longer, but it removes the less-than-ideal manual checks and asserts and things, including removing the Implies struct :-)
proptest threw up some tricky bits, as I can't declare MaybeRV: Arbitrary (without making non-test builds depend upon proptest....). There are a couple of non-compiling commits before the last if you want to see other things I tried...I was puzzled why #[derive(Arbitrary)] on struct Signature<RV: MaybeRV> seemed to be generating an impl <RV: MaybeRV> Arbitrary for Signature that didn't bound on RV: MaybeRV + Arbitrary, the #[proptest(no_bound)] exists to remove said Arbitrary if you don't need it but there doesn't seem to be the opposite #[proptest(yes_bound)] :-(....hence in the end the #[cfg(test)] fn arb.
This enforces "no RowVars in a Type" via Rust, rather than via our checks - we have
TypeBase<NoRV>
orTypeBase<RowVariable>
, withNoRV
an empty enum.There's a bunch more boilerplate (trivial function definitions for NoRV + RowVariable), so overall it's longer, but it removes the less-than-ideal manual checks and asserts and things, including removing the
Implies
struct :-)proptest threw up some tricky bits, as I can't declare
MaybeRV: Arbitrary
(without making non-test builds depend uponproptest
....). There are a couple of non-compiling commits before the last if you want to see other things I tried...I was puzzled why#[derive(Arbitrary)]
onstruct Signature<RV: MaybeRV>
seemed to be generating animpl <RV: MaybeRV> Arbitrary for Signature
that didn't bound onRV: MaybeRV + Arbitrary
, the#[proptest(no_bound)]
exists to remove saidArbitrary
if you don't need it but there doesn't seem to be the opposite#[proptest(yes_bound)]
:-(....hence in the end the#[cfg(test)] fn arb
.See what you think??