Closed jkorinth closed 6 months ago
Thanks for your report!
This code is recursing infinitely in the impl PartialEq<BlockType> for &BlockType
implementation, not inside binrw.
Dereference inside that comparison function so it is actually comparing two BlockType
rather than comparing references (which is where the recursion comes from), or separate #[brw(if)]
into #[br]
(without a deref) and #[bw]
(with a deref) to eliminate the PartialEq<T> for &T
implementation.
Argh, you’re right, sorry! 🤦
MVE:
Would expect this to pass, instead get:
I also tried to wrap the
Block
in aBox
, but that didn't work either.Output of
cargo tree
: