-
-
Notifications
You must be signed in to change notification settings - Fork 444
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
Use const-generics to support arrays of all sizes #1104
Conversation
@dhardy |
Once min-const-generics is stable we'll want a feature flag to opt-in to this behaviour (until bumping the MSRV), so we should add the feature now, yes. Yes, we should just use
|
I think this is mainly waiting on doc updates then? |
Yes sorry for the delay. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more bit of doc and I think we're good to go.
As discussed in #1085, this PR uses
min_const_generics
to add support for random arrays of every size.Currently this uses the existing
nightly
feature.This currently updates the trait bounds on the implementation to require
Default + Copy
, which wasn't required previously, which is a regression compared to what is currently supported.This can either be addressed by using unsafe code and
MaybeUninit
, or adding this newimpl
only for arrays larger than 32.Open questions:
Should this use a new feature flag?Any documentation that needs to be updated?