fix: add generator for arbitrary sized arrays #131
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There were a few recent changes that broke the build in s2n-quic:
In Fix
#[derive(TypeGenerator)]
#126, the generic bounds in derives were changed and broke implementations using arbitrary sized arrays:This is because before we generated a where clause for the whole field type:
and now we generate it just for the generic type:
To work around this, I've implemented TypeGenerator for all array lengths, which is a good idea to do anyway.
In do not require importing bolero_generator or TypeGenerator in order to derive #109, it was set up to prioritize importing
TypeGenerator
from thebolero
crate, if possible. This causes issues for crates likes2n-quic-core
where we export TypeGenerator impls with a feature flag and only usebolero
as a dev-dependency. I've swapped the priorities and this is resolved.To try and prevent this kind of breakage in the future, I've added a workflow to test s2n-quic against any bolero changes. Note that the versions do need to match (they currently don't since the s2n-quic update is blocked on these issues) but I was able to test locally and make sure these are fixed. Moving forward, we should still be able to catch issues before bumping bolero versions.