Skip to content
This repository was archived by the owner on Feb 27, 2026. It is now read-only.

Implement versionize for arrays via const generics#47

Merged
roypat merged 5 commits intofirecracker-microvm:mainfrom
roypat:const-generics
Oct 13, 2023
Merged

Implement versionize for arrays via const generics#47
roypat merged 5 commits intofirecracker-microvm:mainfrom
roypat:const-generics

Conversation

@roypat
Copy link
Copy Markdown
Contributor

@roypat roypat commented Dec 8, 2022

Signed-off-by: Patrick Roy [email protected]

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
Copy Markdown
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

@roypat roypat merged commit c26a84f into firecracker-microvm:main Oct 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants