rust/src/liballoc/tests
bors 4a95e9704d Auto merge of #61953 - Centril:shared-from-iter, r=RalfJung
Add `impl<T> FromIterator<T> for Arc/Rc<[T]>`

Add implementations of `FromIterator<T> for Arc/Rc<[T]>` with symmetrical logic.

This also takes advantage of specialization in the case of iterators with known length (`TrustedLen`) to elide the final allocation/copying from a `Vec<T>` into `Rc<[T]>` because we can allocate the space for the `Rc<[T]>` directly when the size is known. This is the primary motivation and why this is to be preferred over `iter.collect::<Vec<_>>().into(): Rc<[T]>`.

Moreover, this PR does some refactoring in some places.

r? @RalfJung for the code
cc @alexcrichton from T-libs
2019-07-13 06:49:02 +00:00
..
btree Use iter() for iterating arrays by slice 2019-05-17 19:56:35 -07:00
arc.rs shared_from_iter: Polish internal docs. 2019-06-21 23:01:48 +02:00
binary_heap.rs Miri now supports entropy, but is still slow 2019-04-16 20:04:17 +02:00
cow_str.rs Deny rust_2018_idioms in liballoc tests 2019-04-20 16:05:25 +02:00
fmt.rs Remove licenses 2018-12-25 21:08:33 -07:00
heap.rs test more possible overaligned requests 2019-07-02 13:07:51 +02:00
lib.rs shared_from_iter: Add more tests. 2019-06-21 03:52:38 +02:00
linked_list.rs liballoc: refactor & fix some imports. 2019-02-02 10:14:40 +01:00
rc.rs shared_from_iter: Add more tests. 2019-06-21 03:52:38 +02:00
slice.rs test sort_unstable in Miri 2019-04-17 09:47:36 +02:00
str.rs Rollup merge of #59206 - sntdevco:master, r=dtolnay 2019-03-16 22:40:57 +08:00
string.rs Deny rust_2018_idioms in liballoc tests 2019-04-20 16:05:25 +02:00
vec.rs Auto merge of #61224 - aloucks:drain_filter, r=Gankro 2019-07-08 22:03:26 +00:00
vec_deque.rs we can now skip should_panic tests with the libtest harness 2019-03-10 17:47:42 +01:00