rust/library/alloc/tests
bors 69df0f2c2f Auto merge of #102991 - Sp00ph:master, r=scottmcm
Update VecDeque implementation to use head+len instead of head+tail

(See #99805)

This changes `alloc::collections::VecDeque`'s internal representation from using head and tail indices to using a head index and a length field. It has a few advantages over the current design:
* It allows the buffer to be of length 0, which means the `VecDeque::new` new longer has to allocate and could be changed to a `const fn`
* It allows the `VecDeque` to fill the buffer completely, unlike the old implementation, which always had to leave a free space
* It removes the restriction for the size to be a power of two, allowing it to properly `shrink_to_fit`, unlike the old `VecDeque`
* The above points also combine to allow the `Vec<T> -> VecDeque<T>` conversion to be very cheap and guaranteed O(1). I mention this in the `From<Vec<T>>` impl, but it's not a strong guarantee just yet, as that would likely need some form of API change proposal.

All the tests seem to pass for the new `VecDeque`, with some slight adjustments.

r? `@scottmcm`
2022-11-28 10:39:47 +00:00
..
arc.rs Remove Vec/Rc storage reuse opt 2022-11-18 10:39:50 +00:00
autotraits.rs Add regression test for lifetimes in alloc internals autotraits 2022-10-05 12:15:17 -07:00
borrow.rs Move various ui const tests to library 2020-09-04 02:35:27 +02:00
boxed.rs Add #![deny(unsafe_op_in_unsafe_fn)] in liballoc tests 2022-11-23 08:10:17 -08:00
btree_set_hash.rs Include the length in BTree hashes 2021-10-01 12:29:09 -07:00
c_str.rs Remove use of reverted std::ffi::c_char 2022-04-27 14:01:04 -07:00
const_fns.rs impl const Default for Box<[T]> and Box<str> 2022-04-11 12:14:18 -07:00
cow_str.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
fmt.rs enable fuzzy_provenance_casts lint in liballoc 2022-11-20 19:12:18 +01:00
heap.rs Rename AllocRef to Allocator and (de)alloc to (de)allocate 2020-12-04 14:47:15 +01:00
lib.rs Add #![deny(unsafe_op_in_unsafe_fn)] in liballoc tests 2022-11-23 08:10:17 -08:00
linked_list.rs Classify BinaryHeap & LinkedList unit tests as such 2022-03-11 11:33:59 +01:00
rc.rs Remove Vec/Rc storage reuse opt 2022-11-18 10:39:50 +00:00
slice.rs Use Box::new() instead of box syntax in alloc tests 2022-05-29 00:41:14 +02:00
str.rs add test for issue 104726 2022-11-22 20:58:43 +01:00
string.rs Adjust tests for isize::MAX allocation always being checked 2022-03-25 00:57:05 -05:00
thin_box.rs Make use of pointer::is_aligned[_to] 2022-08-21 15:46:03 +04:00
vec_deque.rs Update VecDeque implementation 2022-11-20 15:21:16 +01:00
vec.rs Add #![deny(unsafe_op_in_unsafe_fn)] in liballoc tests 2022-11-23 08:10:17 -08:00