rust/library/alloc/src/vec
Scott McMurray 44b4ce1d61 Make ZST checks in core/alloc more readable
There's a bunch of these checks because of special handing for ZSTs in various unsafe implementations of stuff.

This lets them be `T::IS_ZST` instead of `mem::size_of::<T>() == 0` every time, making them both more readable and more terse.

*Not* proposed for stabilization at this time.  Would be `pub(crate)` except `alloc` wants to use it too.

(And while it doesn't matter now, if we ever get something like 85836 making it a const can help codegen be simpler.)
2022-09-22 23:12:29 -07:00
..
cow.rs Document From impls for cow.rs 2021-05-26 14:21:44 +00:00
drain.rs Make ZST checks in core/alloc more readable 2022-09-22 23:12:29 -07:00
drain_filter.rs fill-in tracking issue for feature(drain_keep_rest) 2022-08-28 17:02:37 +04:00
in_place_collect.rs Make ZST checks in core/alloc more readable 2022-09-22 23:12:29 -07:00
in_place_drop.rs Rename unsigned_offset_from to sub_ptr 2022-05-11 17:16:25 -07:00
into_iter.rs Make ZST checks in core/alloc more readable 2022-09-22 23:12:29 -07:00
is_zero.rs implement IsZero for Saturating and Wrapping 2022-09-02 19:55:01 -04:00
mod.rs Make ZST checks in core/alloc more readable 2022-09-22 23:12:29 -07:00
partial_eq.rs Allow comparing Vecs with different allocators using == 2022-02-08 01:50:55 +00:00
set_len_on_drop.rs refactor: moved SetLenOnDrop to set_len_on_drop 2020-12-29 14:03:30 +00:00
spec_extend.rs Replace most uses of pointer::offset with add and sub 2022-08-21 02:21:41 +04:00
spec_from_elem.rs Support vec zero-alloc optimization for tuples and byte arrays 2022-07-24 15:56:39 -04:00
spec_from_iter.rs Update documentation of SpecFromIter to reflect the removed impls 2021-05-31 21:07:03 +02:00
spec_from_iter_nested.rs Improve estimation of capacity in Vec::from_iter 2022-01-19 09:47:49 -05:00
splice.rs Update expressions where we can use array's IntoIterator implementation 2021-06-02 16:09:04 +06:00