Perhaps the best thing is to wait a month (or two or three) until DST
is more of a reality and then see how we feel.

Are you thinking we should also wait before converting the current uses
of ~[T] to Vec<T>? Doing the migration gives us the performance[1] and
zero-length-zero-alloc benefits, but there were some concerns about
additional library churn if we end up converting back to DST's ~[T].

I can't speak about how a usage choice affects the standard library,
but it seems worth mentioning that vector capacity doesn't have to be
in the base object; it can live in the secondary storage, prepended
before the elements.  A zero-length Vec<T> might be null for the
case of zero capacity, or non-null when it has room to grow.  For
maximally trivial conversion to ~T[], the pointer in Vec<T> would
point to the first element, with the capacity at a negative offset.

Nathan Myers


_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to