about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-05-08 21:01:42 -0700
committerbors <bors@rust-lang.org>2014-05-08 21:01:42 -0700
commita990920c6fff9b762c3d0968ff0a5fdcce6d2b39 (patch)
tree8b4cb2edb2e48660ca6e6c0f6a660951f00c1e02 /src/rustllvm/RustWrapper.cpp
parentc0a25e4fdc1fcdde8378b4177a6f06c58001a3be (diff)
parentdc30c483810ca0ee3641f4bab8e6f2a44a883fee (diff)
downloadrust-a990920c6fff9b762c3d0968ff0a5fdcce6d2b39.tar.gz
rust-a990920c6fff9b762c3d0968ff0a5fdcce6d2b39.zip
auto merge of #13963 : kballard/rust/remove_owned_vec_from_iterator, r=pcwalton
With `~[T]` no longer growable, the `FromIterator` impl for `~[T]` doesn't make
much sense. Not only that, but nearly everywhere it is used is to convert from
a `Vec<T>` into a `~[T]`, for the sake of maintaining existing APIs. This turns
out to be a performance loss, as it means every API that returns `~[T]`, even a
supposedly non-copying one, is in fact doing extra allocations and memcpy's.
Even `&[T].to_owned()` is going through `Vec<T>` first.

Remove the `FromIterator` impl for `~[T]`, and adjust all the APIs that relied
on it to start using `Vec<T>` instead. This includes rewriting
`&[T].to_owned()` to be more efficient, among other performance wins.

Also add a new mechanism to go from `Vec<T>` -> `~[T]`, just in case anyone
truly needs that, using the new trait `FromVec`.

[breaking-change]
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions