std: Make ~[T] no longer a growable vector

This removes all resizability support for ~[T] vectors in preparation of DST.
The only growable vector remaining is Vec<T>. In summary, the following methods
from ~[T] and various functions were removed. Each method/function has an
equivalent on the Vec type in std::vec unless otherwise stated.

* slice::OwnedCloneableVector
* slice::OwnedEqVector
* slice::append
* slice::append_one
* slice::build (no replacement)
* slice::bytes::push_bytes
* slice::from_elem
* slice::from_fn
* slice::with_capacity
* ~[T].capacity()
* ~[T].clear()
* ~[T].dedup()
* ~[T].extend()
* ~[T].grow()
* ~[T].grow_fn()
* ~[T].grow_set()
* ~[T].insert()
* ~[T].pop()
* ~[T].push()
* ~[T].push_all()
* ~[T].push_all_move()
* ~[T].remove()
* ~[T].reserve()
* ~[T].reserve_additional()
* ~[T].reserve_exect()
* ~[T].retain()
* ~[T].set_len()
* ~[T].shift()
* ~[T].shrink_to_fit()
* ~[T].swap_remove()
* ~[T].truncate()
* ~[T].unshift()
* ~str.clear()
* ~str.set_len()
* ~str.truncate()

Note that no other API changes were made. Existing apis that took or returned
~[T] continue to do so.

[breaking-change]
This commit is contained in:
Alex Crichton
2014-04-17 15:28:14 -07:00
parent ce2bab68d6
commit 7d3b0bf391
28 changed files with 344 additions and 1001 deletions

View File

@@ -16,6 +16,7 @@ use fmt;
use io::IoResult;
use io;
use libc;
use mem;
use rt::rtio::{RtioProcess, IoFactory, LocalIo};
/// Signal a process to exit, without forcibly killing it. Corresponds to
@@ -416,12 +417,7 @@ impl Drop for Process {
drop(self.stdin.take());
drop(self.stdout.take());
drop(self.stderr.take());
loop {
match self.extra_io.pop() {
Some(_) => (),
None => break,
}
}
drop(mem::replace(&mut self.extra_io, ~[]));
self.wait();
}