Stream: general

Topic: RawVec crate


Sydney Acksman (Sep 29 2019 at 00:30, on Zulip):

hashbrown has a raw mod if you enable the feature which makes custom hash maps easier to implement. But the std RawVec is locked behind implementation instability, why not separate it into another crate to make custom vecs easier?

gnzlbg (Sep 30 2019 at 07:19, on Zulip):

The RawVec is just something that Vec and Deque need, and it is tailored towards those uses

gnzlbg (Sep 30 2019 at 07:19, on Zulip):

We should probably remove the feature gate since it probably won't be ever exposed at all

gnzlbg (Sep 30 2019 at 07:19, on Zulip):

cc @Amanieu @Simon Sapin

gnzlbg (Sep 30 2019 at 07:20, on Zulip):

even changing tiny details like the growth factor would prevent reusing RawVec

gnzlbg (Sep 30 2019 at 07:21, on Zulip):

since e.g. the Vec/Deque/etc. make use of knowledge of the precise growth factor, and IIRC deque constrains it

gnzlbg (Sep 30 2019 at 07:22, on Zulip):

I don't know why there is a feature that exports it

gnzlbg (Sep 30 2019 at 07:22, on Zulip):

there never was an RFC for that AFAIK

gnzlbg (Sep 30 2019 at 07:23, on Zulip):

If someone finds it useful they can just copy&paste RawVec into a different crate, but I don't know of any collection actually using the libstd one, chances are you are going to have to modify RawVec in subtle ways

Sydney Acksman (Sep 30 2019 at 15:51, on Zulip):

I noticed it also used by libarena but I don't know where that's used.

centril (Sep 30 2019 at 22:03, on Zulip):

libarena is just used internally in the compiler

RalfJ (Oct 09 2019 at 13:17, on Zulip):

@gnzlbg there's a feature gate in hashbrown, I don't think there is one for RawVec?

gnzlbg (Oct 09 2019 at 13:39, on Zulip):

I think that for “raw” hash table functionality there is a pre-RFC or similar in internals

gnzlbg (Oct 09 2019 at 13:39, on Zulip):

I don’t recall anything like that for RawVec

Last update: Nov 21 2019 at 23:30UTC