about summary refs log tree commit diff
path: root/src/libstd/sys/vxworks/stack_overflow.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-07-13 06:49:02 +0000
committerbors <bors@rust-lang.org>2019-07-13 06:49:02 +0000
commit4a95e9704de0eeaecba55df102c1129e79a3a929 (patch)
tree363bc1700a2826f38735027195160fa84ecefc2c /src/libstd/sys/vxworks/stack_overflow.rs
parenta9c7febb879689a3d24e3ba34531026930313c4c (diff)
parent85def307fc83f8c0d164b1506bb855dfaed5f8b5 (diff)
downloadrust-4a95e9704de0eeaecba55df102c1129e79a3a929.tar.gz
rust-4a95e9704de0eeaecba55df102c1129e79a3a929.zip
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
Diffstat (limited to 'src/libstd/sys/vxworks/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions