rust/library/alloc/tests
Yuki Okushi 785237d392
Rollup merge of #104435 - scottmcm:iter-repeat-n, r=thomcc
`VecDeque::resize` should re-use the buffer in the passed-in element

Today it always copies it for *every* appended element, but one of those clones is avoidable.

This adds `iter::repeat_n` (https://github.com/rust-lang/rust/issues/104434) as the primitive needed to do this.  If this PR is acceptable, I'll also use this in `Vec` rather than its custom `ExtendElement` type & infrastructure that is harder to share between multiple different containers:

101e1822c3/library/alloc/src/vec/mod.rs (L2479-L2492)
2022-11-20 13:15:59 +09: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
boxed.rs
btree_set_hash.rs
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
fmt.rs liballoc tests: avoid int2ptr cast 2022-06-27 10:50:56 -04:00
heap.rs
lib.rs Add regression test for lifetimes in alloc internals autotraits 2022-10-05 12:15:17 -07: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 generalize str.contains() tests to a range of haystack sizes 2022-11-15 18:30:07 +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 VecDeque::resize should re-use the buffer in the passed-in element 2022-11-15 00:53:26 -08:00
vec.rs Rollup merge of #101642 - SkiFire13:fix-inplace-collection-leak, r=the8472 2022-10-04 16:11:01 +05:30