-
Notifications
You must be signed in to change notification settings - Fork 146
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
[meta] Wishlist for smallvec 1.0 #73
Comments
Regarding specialization, I can see how the |
Specializing these would require adding an intermediate trait with a default impl and specialized impls, like libstd's |
Might I suggest adding an updated
|
Many of the unstable Rust features seem unlikely to stabilize any time soon. I think we should consider making a 1.0 release in the near future (sometime this year) which would include everything that is stable now (or in the very near future), and then make a 2.0 release much later (probably 2 or more years from now) with features that stabilize later. The following would be delayed until 2.0 or later:
The following might be ready in time for 1.0:
It might be worth waiting until MaybeUninit is stabilized, since that fixes a potentially critical soundness issue. Alternately we could use build-time rustc version detection to conditionally use MaybeUninit, but this would increase code complexity and we would need to live with it for potentially a long time. |
|
I really hope that v1.0 version will use const generics. Yes, stabilization is unlikely to happen in the near future (6-12 months), but at least it's on horizon, which can not be said about specialization. |
I posted a PR for a 1.0.0 release in #175 I'd like to publish this as soon as possible, because lack of |
There's a neat trick written up by @dtolnay to emulate specialization on stable. I haven't looked too deeply into how well that performs, but it's probably worth a shot trying to use it. |
@mbrubeck thank you for putting work into this! Seems like the issue can be closed and a new one, wishlist for 2.0, opened instead |
Filed #183 to track 2.0 progress. |
This isn't a fatcat rust requirement, but instead a diesel requirement, via rust-smallvec, which in v1.0 uses the alloc crate: servo/rust-smallvec#73 I think the reason this came up now is that diesel-cli is an application and doesn't have a Cargo.lock file, and the build was updated. Using some binary mechanism to install these dependencies would be more robust, but feels like a yak shave right now.
This is a list of breaking changes that we would like to make before stabilizing the API for smallvec 1.0.
Increases the minimum Rust version from 1.20:
alloc
crate forno_std
compatibility (alloc is now stable #159, Requires Rust 1.36).mem::uninitialized
withMaybeUninit
(Possible UB from use of uninitialized[&T; N]
#126, Requires Rust 1.36).NonNull<T>
instead of*mut T
(Use NonNull instead of a raw pointer #171, Requires Rust 1.25).unreachable
crate withstd::hint::unreachable_unchecked
(Maybe remove the 'unreachable' crate dependency? #128, Requires Rust 1.27).Breaking API changes:
drain
method to take aRangeBounds
argument (change drain to be consistent withVec
#142, Requires Rust 1.28).Deprecations:
SmallVecN
type aliases.push_all_move
method.VecLike
trait.Still depends on unstable Rust features. Postpone until 2.0:
SmallVec<[T; N]>
toSmallVec<T, N>
. Remove theArray
trait. (Tracking issue for const generics (RFC 2000) rust-lang/rust#44580).extend
,insert_many
, andfrom
for slices ofCopy
types. Deprecate and removeextend_from_slice
,insert_from_slice
, andfrom_slice
(Tracking issue for specialization (RFC 1210) rust-lang/rust#31844).union
representation by default and remove the optionalunion
feature added in Use a union to reduce the size of SmallVec [v2] #94 (Untagged unions (tracking issue for RFC 1444) rust-lang/rust#32836).The text was updated successfully, but these errors were encountered: