Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement versionize for arrays via const generics #47

Merged
merged 5 commits into from
Oct 13, 2023

Conversation

roypat
Copy link
Contributor

@roypat roypat commented Dec 8, 2022

Signed-off-by: Patrick Roy roypat@amazon.co.uk

Reason for This PR

resolves a TODO. const generics have been stablized since 1.51

Description of Changes

Remove the macro generated impls up to array size 32 with a completely generic version based on const generics

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license.

PR Checklist

[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]

  • All commits in this PR are signed (git commit -s).
  • The reason for this PR is clearly provided (issue no. or explanation).
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • Any newly added unsafe code is properly documented.
  • Any user-facing changes are mentioned in CHANGELOG.md.

@roypat
Copy link
Contributor Author

roypat commented Dec 8, 2022

I'd absolutely love to get rid of the Default + Copy bound as well by using MaybeUninit (this is the stereotypical usecase for it according to the rust docs), but sadly that doesn't seem to be supported with generic T :( rust-lang/rust#61956

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
@roypat roypat merged commit c26a84f into firecracker-microvm:main Oct 13, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants