Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[meta] Wishlist for smallvec 1.0 #73

Closed
8 of 12 tasks
mbrubeck opened this issue Nov 29, 2017 · 10 comments
Closed
8 of 12 tasks

[meta] Wishlist for smallvec 1.0 #73

mbrubeck opened this issue Nov 29, 2017 · 10 comments

Comments

@mbrubeck
Copy link
Collaborator

mbrubeck commented Nov 29, 2017

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:

Breaking API changes:

Deprecations:

  • Remove deprecated SmallVecN type aliases.
  • Remove deprecated push_all_move method.
  • Remove deprecated VecLike trait.

Still depends on unstable Rust features. Postpone until 2.0:

@llogiq
Copy link
Contributor

llogiq commented Aug 23, 2018

Regarding specialization, I can see how the From implementation can work out, but wouldn't Extend and insert_many violate coherence rules?

@mbrubeck
Copy link
Collaborator Author

Specializing these would require adding an intermediate trait with a default impl and specialized impls, like libstd's impl Extend for Vec.

@cbarrick
Copy link

Might I suggest adding an updated drain to the list.

SmallVec::drain was implemented in #26, but does not accept a range argument like Vec::drain. At the time, RangeArgument (now RangeBounds) had not stabilized. RangeBounds is now stable since Rust 1.28.

@mbrubeck
Copy link
Collaborator Author

mbrubeck commented Mar 20, 2019

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:

  • const generics
  • custom allocators
  • specialization

The following might be ready in time for 1.0:

  • MaybeUninit
  • liballoc
  • union

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.

@lambda-fairy
Copy link

MaybeUninit and alloc are now stable. Do we want to update this issue?

@newpavlov
Copy link

newpavlov commented Sep 12, 2019

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.

@mbrubeck
Copy link
Collaborator Author

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 MaybeUninit in existing releases is UB waiting to happen, and is already impacting downstream projects that run MIRI tests. We can release a 2.0 version next year or whenever const generics are ready.

@llogiq
Copy link
Contributor

llogiq commented Oct 30, 2019

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.

@jdm jdm mentioned this issue Oct 31, 2019
@matklad
Copy link

matklad commented Nov 15, 2019

@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

@mbrubeck
Copy link
Collaborator Author

Filed #183 to track 2.0 progress.

bnewbold added a commit to internetarchive/fatcat that referenced this issue Dec 3, 2019
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.
@mbrubeck mbrubeck changed the title [meta] Wishlist for 1.0 [meta] Wishlist for smallvec 1.0 Apr 22, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants