-
Notifications
You must be signed in to change notification settings - Fork 196
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
Tracking issue for migrating from GenericArray
to const generics
#970
Comments
Something I've been experimenting with is I started by trying to modify I think a crate like this could provide a useful stepping stone for incrementally migrating to const generics. |
There's been some talk about potentially stabilizing associated constant support as the next step for const generic stabilization: rust-lang/rust#76560 (comment) |
I've published a crate named It can hopefully provide a stepping stone from where we're at now towards a full migration to const generics. Ideally this would include being able to use const generic core arrays in public-facing APIs. |
We've migrated to |
Closing this out in favor of #1481, now that the migration from |
We've had an informal plan to migrate from the
generic-array
/typenum
crates for years. People ask about it quite frequently ever sincemin_const_generics
have been stabilized. I thought it would be good to have a tracking issue we can point people to.Unfortunately
min_const_generics
is not quite up to the challenge of replacing our existing usages ofgeneric-array
. Here are open issues tracking the two main features we need upstream:feature(generic_const_exprs)
rust-lang/rust#76560The first issue (60551) is arguably the biggest blocker. All of the trait crates defined in this repo use associated
ArrayLength
types which would be best replaced by associated constants. While it would be possible to switch from associated constants to const generic parameters, this has all the drawbacks of using explicit generic parameters versus families of them expressed as associated types. It becomes quite unwieldy when there are several of them involved. Our use cases benefit from these constants being "carried along" with another generic parameter, so it would be best to wait until this feature is implemented.The second issue (76560) is important because we do quite a bit of arithmetic with
typenum
.It will probably be a year or two before these features are implemented upstream, at which point we can consider a wholesale migration to const generics.
The text was updated successfully, but these errors were encountered: