This is doing some pointer casts that make the assumption that TreeWalkCbData is transparent, when it is not declared as such. Although this is unlikely to be an issue in practice, it breaks the rules about repr(rust) type layout. This reworks it to avoid that assumption. I think it could potentially be repr(transparent), but I'm not sure that is really necessary. There's probably a better way to avoid the wrapper, but I'm not inclined to try to find it.
This is doing some pointer casts that make the assumption that
TreeWalkCbData
is transparent, when it is not declared as such. Although this is unlikely to be an issue in practice, it breaks the rules about repr(rust) type layout. This reworks it to avoid that assumption. I think it could potentially berepr(transparent)
, but I'm not sure that is really necessary. There's probably a better way to avoid the wrapper, but I'm not inclined to try to find it.