Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for FixedSizeArray trait #27778
Comments
alexcrichton
added
T-libs
B-unstable
labels
Aug 13, 2015
This comment has been minimized.
This comment has been minimized.
|
Note that the |
This comment has been minimized.
This comment has been minimized.
|
The FixedSizeArray trait would be great, except for many uses the ranges of sizes it's implemented for simply isn't what you need, and there is no way to expand it. Thus it is mostly useless in the current form. |
This comment has been minimized.
This comment has been minimized.
|
Could the compiler magically have an "infinite" (generated on demand) number of impls of If that happens and the type parameter is made into an associated type (and maybe an associated const for the size is added), then most of the other impls that currently only go up to N=32 could be made generic |
This comment has been minimized.
This comment has been minimized.
|
If/when the issue of using associated consts like consts is resolved, that is, allow This suggests to me that completing associated constants is basically the same problem as allowing generic integer parameters. |
This comment has been minimized.
This comment has been minimized.
|
for now |
This comment has been minimized.
This comment has been minimized.
|
https://crates.io/crates/arrayvec has a similar trait, called |
This comment has been minimized.
This comment has been minimized.
|
Triage: no changes |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I wrote rust-lang/rfcs#1915 about extending and stabilizing this trait. |
alexcrichton commentedAug 13, 2015
This is a tracking issue for the unstable
fixed_size_arrayfeature in the standard library. This is likely to be deprecated and removed in favor of generic integers one day, and in the meantime there are not many consumers of it.