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

Const generics implementation #3

Closed
est31 opened this issue May 17, 2019 · 5 comments
Closed

Const generics implementation #3

est31 opened this issue May 17, 2019 · 5 comments

Comments

@est31
Copy link
Owner

est31 commented May 17, 2019

It seems that serde has a [T; 0] optimization that we most likely won't be able to support in the initial stable version of const generics, so it's possible that this crate will be needed for longer, especially during early availability of const generics on stable. Thus we should think about adding a trait implemented for all array sizes using const generics to this crate eventually. For now, we should do an experiment.

@est31
Copy link
Owner Author

est31 commented Jun 7, 2019

There is a hack available to make the [T; 0] implementation work: rust-lang/rust#61383

@est31
Copy link
Owner Author

est31 commented Jun 7, 2019

See 9ece314 .

@est31
Copy link
Owner Author

est31 commented Oct 2, 2019

See ce075a7

@est31
Copy link
Owner Author

est31 commented Apr 19, 2020

It compiles now, very nice. See 0cbd7f3

So it's usable on nightly Rust right now on serde-big-array master as well as on the 0.2.0 crates.io release. I keep the issue open only to track stabilization of const generics upstream so that I don't forget to remove the feature gates once it stabilizes.

@est31
Copy link
Owner Author

est31 commented Apr 15, 2021

Feature gate got removed by a05c0fb . Users of rust 1.51.0 and beyond can use 0.3.1 and beyond. In the 0.4.x branch, my plan is to enable const-generics by default.

@est31 est31 closed this as completed Apr 15, 2021
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

No branches or pull requests

1 participant