about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/compiletest/runtest.rs7
-rw-r--r--src/doc/guide-tasks.md26
-rw-r--r--src/doc/tutorial.md8
-rw-r--r--src/libnative/io/addrinfo.rs4
-rw-r--r--src/libnative/io/file_unix.rs3
-rw-r--r--src/libnative/io/process.rs16
-rw-r--r--src/librustc/back/rpath.rs2
-rw-r--r--src/librustc/lib.rs4
-rw-r--r--src/librustc/middle/dataflow.rs7
-rw-r--r--src/librustc/middle/trans/callee.rs7
-rw-r--r--src/librustc/middle/trans/consts.rs6
-rw-r--r--src/librustc/middle/trans/debuginfo.rs9
-rw-r--r--src/librustc/middle/trans/expr.rs5
-rw-r--r--src/librustc/middle/typeck/check/mod.rs5
-rw-r--r--src/librustc/middle/typeck/infer/region_inference/mod.rs9
-rw-r--r--src/librustc/util/sha2.rs3
-rw-r--r--src/librustdoc/html/render.rs3
-rw-r--r--src/librustdoc/test.rs4
-rw-r--r--src/librustuv/addrinfo.rs4
-rw-r--r--src/librustuv/file.rs5
-rw-r--r--src/librustuv/process.rs17
-rw-r--r--src/libserialize/base64.rs14
-rw-r--r--src/libserialize/ebml.rs20
-rw-r--r--src/libserialize/hex.rs9
-rw-r--r--src/libserialize/json.rs10
-rw-r--r--src/libserialize/serialize.rs13
-rw-r--r--src/libstd/comm/shared.rs1
-rw-r--r--src/libstd/comm/stream.rs1
-rw-r--r--src/libstd/hash/sip.rs11
-rw-r--r--src/libstd/io/buffered.rs6
-rw-r--r--src/libstd/io/extensions.rs11
-rw-r--r--src/libstd/io/mem.rs2
-rw-r--r--src/libstd/io/mod.rs4
-rw-r--r--src/libstd/io/process.rs8
-rw-r--r--src/libstd/io/signal.rs2
-rw-r--r--src/libstd/local_data.rs2
-rw-r--r--src/libstd/num/int_macros.rs4
-rw-r--r--src/libstd/num/mod.rs3
-rw-r--r--src/libstd/num/strconv.rs42
-rw-r--r--src/libstd/num/uint_macros.rs4
-rw-r--r--src/libstd/os.rs70
-rw-r--r--src/libstd/path/mod.rs2
-rw-r--r--src/libstd/path/posix.rs2
-rw-r--r--src/libstd/path/windows.rs2
-rw-r--r--src/libstd/prelude.rs2
-rw-r--r--src/libstd/ptr.rs5
-rw-r--r--src/libstd/repr.rs2
-rw-r--r--src/libstd/rt/args.rs7
-rw-r--r--src/libstd/slice.rs1052
-rw-r--r--src/libstd/str.rs93
-rw-r--r--src/libstd/sync/arc.rs6
-rw-r--r--src/libstd/sync/deque.rs2
-rw-r--r--src/libstd/unstable/sync.rs2
-rw-r--r--src/libstd/vec.rs38
-rw-r--r--src/libsyntax/ext/format.rs5
-rw-r--r--src/test/bench/core-map.rs9
-rw-r--r--src/test/bench/shootout-fannkuch-redux.rs11
-rw-r--r--src/test/bench/shootout-fasta-redux.rs5
-rw-r--r--src/test/bench/shootout-spectralnorm.rs1
-rw-r--r--src/test/compile-fail/lint-deprecated-owned-vector.rs1
-rw-r--r--src/test/compile-fail/lint-unused-imports.rs9
-rw-r--r--src/test/run-pass/backtrace.rs2
62 files changed, 483 insertions, 1166 deletions
diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs
index 1885f20bd88..17b5aa4a83a 100644
--- a/src/compiletest/runtest.rs
+++ b/src/compiletest/runtest.rs
@@ -33,7 +33,6 @@ use std::os;
 use std::str;
 use std::strbuf::StrBuf;
 use std::task;
-use std::slice;
 use test::MetricMap;
 
 pub fn run(config: config, testfile: ~str) {
@@ -509,7 +508,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
                          proc_res: &ProcRes) {
 
     // true if we found the error in question
-    let mut found_flags = slice::from_elem(
+    let mut found_flags = Vec::from_elem(
         expected_errors.len(), false);
 
     if proc_res.status.success() {
@@ -554,13 +553,13 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
     for line in proc_res.stderr.lines() {
         let mut was_expected = false;
         for (i, ee) in expected_errors.iter().enumerate() {
-            if !found_flags[i] {
+            if !*found_flags.get(i) {
                 debug!("prefix={} ee.kind={} ee.msg={} line={}",
                        *prefixes.get(i), ee.kind, ee.msg, line);
                 if prefix_matches(line, *prefixes.get(i)) &&
                     line.contains(ee.kind) &&
                     line.contains(ee.msg) {
-                    found_flags[i] = true;
+                    *found_flags.get_mut(i) = true;
                     was_expected = true;
                     break;
                 }
diff --git a/src/doc/guide-tasks.md b/src/doc/guide-tasks.md
index 2ffa4529f08..5dd58ccb61d 100644
--- a/src/doc/guide-tasks.md
+++ b/src/doc/guide-tasks.md
@@ -255,10 +255,9 @@ might look like the example below.
 
 ~~~
 # use std::task::spawn;
-# use std::slice;
 
 // Create a vector of ports, one for each child task
-let rxs = slice::from_fn(3, |init_val| {
+let rxs = Vec::from_fn(3, |init_val| {
     let (tx, rx) = channel();
     spawn(proc() {
         tx.send(some_expensive_computation(init_val));
@@ -304,7 +303,6 @@ be distributed on the available cores.
 
 ~~~
 # extern crate sync;
-# use std::slice;
 fn partial_sum(start: uint) -> f64 {
     let mut local_sum = 0f64;
     for num in range(start*100000, (start+1)*100000) {
@@ -314,7 +312,7 @@ fn partial_sum(start: uint) -> f64 {
 }
 
 fn main() {
-    let mut futures = slice::from_fn(1000, |ind| sync::Future::spawn( proc() { partial_sum(ind) }));
+    let mut futures = Vec::from_fn(1000, |ind| sync::Future::spawn( proc() { partial_sum(ind) }));
 
     let mut final_res = 0f64;
     for ft in futures.mut_iter()  {
@@ -342,15 +340,14 @@ a single large vector of floats. Each task needs the full vector to perform its
 extern crate rand;
 extern crate sync;
 
-use std::slice;
 use sync::Arc;
 
-fn pnorm(nums: &~[f64], p: uint) -> f64 {
+fn pnorm(nums: &[f64], p: uint) -> f64 {
     nums.iter().fold(0.0, |a,b| a+(*b).powf(&(p as f64)) ).powf(&(1.0 / (p as f64)))
 }
 
 fn main() {
-    let numbers = slice::from_fn(1000000, |_| rand::random::<f64>());
+    let numbers = Vec::from_fn(1000000, |_| rand::random::<f64>());
     let numbers_arc = Arc::new(numbers);
 
     for num in range(1u, 10) {
@@ -358,9 +355,9 @@ fn main() {
         tx.send(numbers_arc.clone());
 
         spawn(proc() {
-            let local_arc : Arc<~[f64]> = rx.recv();
+            let local_arc : Arc<Vec<f64>> = rx.recv();
             let task_numbers = &*local_arc;
-            println!("{}-norm = {}", num, pnorm(task_numbers, num));
+            println!("{}-norm = {}", num, pnorm(task_numbers.as_slice(), num));
         });
     }
 }
@@ -374,9 +371,8 @@ created by the line
 # extern crate sync;
 # extern crate rand;
 # use sync::Arc;
-# use std::slice;
 # fn main() {
-# let numbers = slice::from_fn(1000000, |_| rand::random::<f64>());
+# let numbers = Vec::from_fn(1000000, |_| rand::random::<f64>());
 let numbers_arc=Arc::new(numbers);
 # }
 ~~~
@@ -387,9 +383,8 @@ and a clone of it is sent to each task
 # extern crate sync;
 # extern crate rand;
 # use sync::Arc;
-# use std::slice;
 # fn main() {
-# let numbers=slice::from_fn(1000000, |_| rand::random::<f64>());
+# let numbers=Vec::from_fn(1000000, |_| rand::random::<f64>());
 # let numbers_arc = Arc::new(numbers);
 # let (tx, rx) = channel();
 tx.send(numbers_arc.clone());
@@ -404,13 +399,12 @@ Each task recovers the underlying data by
 # extern crate sync;
 # extern crate rand;
 # use sync::Arc;
-# use std::slice;
 # fn main() {
-# let numbers=slice::from_fn(1000000, |_| rand::random::<f64>());
+# let numbers=Vec::from_fn(1000000, |_| rand::random::<f64>());
 # let numbers_arc=Arc::new(numbers);
 # let (tx, rx) = channel();
 # tx.send(numbers_arc.clone());
-# let local_arc : Arc<~[f64]> = rx.recv();
+# let local_arc : Arc<Vec<f64>> = rx.recv();
 let task_numbers = &*local_arc;
 # }
 ~~~
diff --git a/src/doc/tutorial.md b/src/doc/tutorial.md
index b52e1abc1a3..336f296ba25 100644
--- a/src/doc/tutorial.md
+++ b/src/doc/tutorial.md
@@ -1582,12 +1582,12 @@ the elements are mutable if the vector is mutable.
 use std::strbuf::StrBuf;
 
 // A dynamically sized vector (unique vector)
-let mut numbers = ~[1, 2, 3];
+let mut numbers = vec![1, 2, 3];
 numbers.push(4);
 numbers.push(5);
 
 // The type of a unique vector is written as `~[int]`
-let more_numbers: ~[int] = numbers;
+let more_numbers: ~[int] = numbers.move_iter().collect();
 
 // The original `numbers` value can no longer be used, due to move semantics.
 
@@ -1955,8 +1955,8 @@ vector consisting of the result of applying `function` to each element
 of `vector`:
 
 ~~~~
-fn map<T, U>(vector: &[T], function: |v: &T| -> U) -> ~[U] {
-    let mut accumulator = ~[];
+fn map<T, U>(vector: &[T], function: |v: &T| -> U) -> Vec<U> {
+    let mut accumulator = Vec::new();
     for element in vector.iter() {
         accumulator.push(function(element));
     }
diff --git a/src/libnative/io/addrinfo.rs b/src/libnative/io/addrinfo.rs
index 5b872a2dbc5..71944202205 100644
--- a/src/libnative/io/addrinfo.rs
+++ b/src/libnative/io/addrinfo.rs
@@ -57,7 +57,7 @@ impl GetAddrInfoRequest {
         }
 
         // Collect all the results we found
-        let mut addrs = ~[];
+        let mut addrs = Vec::new();
         let mut rp = res;
         while rp.is_not_null() {
             unsafe {
@@ -80,7 +80,7 @@ impl GetAddrInfoRequest {
 
         unsafe { freeaddrinfo(res); }
 
-        Ok(addrs)
+        Ok(addrs.move_iter().collect())
     }
 }
 
diff --git a/src/libnative/io/file_unix.rs b/src/libnative/io/file_unix.rs
index 5446ab2950e..d97a0430fea 100644
--- a/src/libnative/io/file_unix.rs
+++ b/src/libnative/io/file_unix.rs
@@ -18,7 +18,6 @@ use libc::{c_int, c_void};
 use libc;
 use std::mem;
 use std::rt::rtio;
-use std::slice;
 
 use io::{IoResult, retry, keep_going};
 
@@ -416,7 +415,7 @@ pub fn readlink(p: &CString) -> IoResult<Path> {
     if len == -1 {
         len = 1024; // FIXME: read PATH_MAX from C ffi?
     }
-    let mut buf = slice::with_capacity::<u8>(len as uint);
+    let mut buf: Vec<u8> = Vec::with_capacity(len as uint);
     match retry(|| unsafe {
         libc::readlink(p, buf.as_ptr() as *mut libc::c_char,
                        len as libc::size_t) as libc::c_int
diff --git a/src/libnative/io/process.rs b/src/libnative/io/process.rs
index e3bb938995b..385287d998e 100644
--- a/src/libnative/io/process.rs
+++ b/src/libnative/io/process.rs
@@ -74,7 +74,7 @@ impl Process {
             return Err(super::unimpl());
         }
 
-        fn get_io(io: p::StdioContainer, ret: &mut ~[Option<file::FileDesc>])
+        fn get_io(io: p::StdioContainer, ret: &mut Vec<Option<file::FileDesc>>)
             -> (Option<os::Pipe>, c_int)
         {
             match io {
@@ -93,7 +93,7 @@ impl Process {
             }
         }
 
-        let mut ret_io = ~[];
+        let mut ret_io = Vec::new();
         let (in_pipe, in_fd) = get_io(config.stdin, &mut ret_io);
         let (out_pipe, out_fd) = get_io(config.stdout, &mut ret_io);
         let (err_pipe, err_fd) = get_io(config.stderr, &mut ret_io);
@@ -117,7 +117,7 @@ impl Process {
                         exit_code: None,
                         exit_signal: None,
                     },
-                    ret_io))
+                    ret_io.move_iter().collect()))
             }
             Err(e) => Err(e)
         }
@@ -641,12 +641,10 @@ fn spawn_process_os(config: p::ProcessConfig,
 
 #[cfg(unix)]
 fn with_argv<T>(prog: &str, args: &[~str], cb: proc(**libc::c_char) -> T) -> T {
-    use std::slice;
-
     // We can't directly convert `str`s into `*char`s, as someone needs to hold
     // a reference to the intermediary byte buffers. So first build an array to
     // hold all the ~[u8] byte strings.
-    let mut tmps = slice::with_capacity(args.len() + 1);
+    let mut tmps = Vec::with_capacity(args.len() + 1);
 
     tmps.push(prog.to_c_str());
 
@@ -667,14 +665,12 @@ fn with_argv<T>(prog: &str, args: &[~str], cb: proc(**libc::c_char) -> T) -> T {
 
 #[cfg(unix)]
 fn with_envp<T>(env: Option<~[(~str, ~str)]>, cb: proc(*c_void) -> T) -> T {
-    use std::slice;
-
     // On posixy systems we can pass a char** for envp, which is a
     // null-terminated array of "k=v\n" strings. Like `with_argv`, we have to
     // have a temporary buffer to hold the intermediary `~[u8]` byte strings.
     match env {
         Some(env) => {
-            let mut tmps = slice::with_capacity(env.len());
+            let mut tmps = Vec::with_capacity(env.len());
 
             for pair in env.iter() {
                 let kv = format!("{}={}", *pair.ref0(), *pair.ref1());
@@ -700,7 +696,7 @@ fn with_envp<T>(env: Option<~[(~str, ~str)]>, cb: |*mut c_void| -> T) -> T {
     // \0 to terminate.
     match env {
         Some(env) => {
-            let mut blk = ~[];
+            let mut blk = Vec::new();
 
             for pair in env.iter() {
                 let kv = format!("{}={}", *pair.ref0(), *pair.ref1());
diff --git a/src/librustc/back/rpath.rs b/src/librustc/back/rpath.rs
index e455c4ad23c..b96e4b06c46 100644
--- a/src/librustc/back/rpath.rs
+++ b/src/librustc/back/rpath.rs
@@ -156,8 +156,6 @@ pub fn minimize_rpaths(rpaths: &[~str]) -> Vec<~str> {
 
 #[cfg(unix, test)]
 mod test {
-    use std::os;
-
     use back::rpath::get_install_prefix_rpath;
     use back::rpath::{minimize_rpaths, rpaths_to_flags, get_rpath_relative_to_output};
     use syntax::abi;
diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs
index 411d9019632..7b1d0068035 100644
--- a/src/librustc/lib.rs
+++ b/src/librustc/lib.rs
@@ -223,13 +223,13 @@ pub fn describe_codegen_flags() {
 }
 
 pub fn run_compiler(args: &[~str]) {
-    let mut args = args.to_owned();
+    let mut args = Vec::from_slice(args);
     let binary = args.shift().unwrap();
 
     if args.is_empty() { usage(binary); return; }
 
     let matches =
-        &match getopts::getopts(args, d::optgroups().as_slice()) {
+        &match getopts::getopts(args.as_slice(), d::optgroups().as_slice()) {
           Ok(m) => m,
           Err(f) => {
             d::early_error(f.to_err_msg());
diff --git a/src/librustc/middle/dataflow.rs b/src/librustc/middle/dataflow.rs
index 13e16ec9d82..f7a30ff4459 100644
--- a/src/librustc/middle/dataflow.rs
+++ b/src/librustc/middle/dataflow.rs
@@ -18,7 +18,6 @@
 
 
 use std::io;
-use std::slice;
 use std::strbuf::StrBuf;
 use std::uint;
 use syntax::ast;
@@ -308,13 +307,13 @@ impl<'a, O:DataFlowOperator+Clone+'static> DataFlowContext<'a, O> {
                 changed: true
             };
 
-            let mut temp = slice::from_elem(self.words_per_id, 0u);
+            let mut temp = Vec::from_elem(self.words_per_id, 0u);
             let mut loop_scopes = Vec::new();
 
             while propcx.changed {
                 propcx.changed = false;
-                propcx.reset(temp);
-                propcx.walk_block(blk, temp, &mut loop_scopes);
+                propcx.reset(temp.as_mut_slice());
+                propcx.walk_block(blk, temp.as_mut_slice(), &mut loop_scopes);
             }
         }
 
diff --git a/src/librustc/middle/trans/callee.rs b/src/librustc/middle/trans/callee.rs
index 372bba6d51c..4aaa9760e89 100644
--- a/src/librustc/middle/trans/callee.rs
+++ b/src/librustc/middle/trans/callee.rs
@@ -16,8 +16,6 @@
  * closure.
  */
 
-use std::slice;
-
 use back::abi;
 use driver::session;
 use lib::llvm::{ValueRef, NoAliasAttribute, StructRetAttribute, NoCaptureAttribute};
@@ -221,11 +219,12 @@ fn resolve_default_method_vtables(bcx: &Block,
         Some(vtables) => {
             let num_impl_type_parameters =
                 vtables.len() - num_method_vtables;
-            vtables.tailn(num_impl_type_parameters).to_owned()
+            Vec::from_slice(vtables.tailn(num_impl_type_parameters))
         },
-        None => slice::from_elem(num_method_vtables, @Vec::new())
+        None => Vec::from_elem(num_method_vtables, @Vec::new())
     };
 
+    let method_vtables = method_vtables.as_slice();
     let param_vtables = @((*trait_vtables_fixed).clone().append(method_vtables));
 
     let self_vtables = resolve_param_vtables_under_param_substs(
diff --git a/src/librustc/middle/trans/consts.rs b/src/librustc/middle/trans/consts.rs
index e0a54234fca..03b442bae21 100644
--- a/src/librustc/middle/trans/consts.rs
+++ b/src/librustc/middle/trans/consts.rs
@@ -593,11 +593,11 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr,
                 const_eval::const_uint(i) => i as uint,
                 _ => cx.sess().span_bug(count.span, "count must be integral const expression.")
             };
-            let vs = slice::from_elem(n, const_expr(cx, elem, is_local).val0());
+            let vs = Vec::from_elem(n, const_expr(cx, elem, is_local).val0());
             let v = if vs.iter().any(|vi| val_ty(*vi) != llunitty) {
-                C_struct(cx, vs, false)
+                C_struct(cx, vs.as_slice(), false)
             } else {
-                C_array(llunitty, vs)
+                C_array(llunitty, vs.as_slice())
             };
             (v, true)
           }
diff --git a/src/librustc/middle/trans/debuginfo.rs b/src/librustc/middle/trans/debuginfo.rs
index 0514642c583..60c6c5ee97a 100644
--- a/src/librustc/middle/trans/debuginfo.rs
+++ b/src/librustc/middle/trans/debuginfo.rs
@@ -148,7 +148,6 @@ use collections::HashMap;
 use collections::HashSet;
 use libc::{c_uint, c_ulonglong, c_longlong};
 use std::ptr;
-use std::slice;
 use std::strbuf::StrBuf;
 use std::sync::atomics;
 use syntax::codemap::{Span, Pos};
@@ -776,7 +775,7 @@ pub fn create_function_debug_context(cx: &CrateContext,
             return create_DIArray(DIB(cx), []);
         }
 
-        let mut signature = slice::with_capacity(fn_decl.inputs.len() + 1);
+        let mut signature = Vec::with_capacity(fn_decl.inputs.len() + 1);
 
         // Return type -- llvm::DIBuilder wants this at index 0
         match fn_decl.output.node {
@@ -818,7 +817,7 @@ pub fn create_function_debug_context(cx: &CrateContext,
             signature.push(type_metadata(cx, arg_type, codemap::DUMMY_SP));
         }
 
-        return create_DIArray(DIB(cx), signature);
+        return create_DIArray(DIB(cx), signature.as_slice());
     }
 
     fn get_template_parameters(cx: &CrateContext,
@@ -961,7 +960,7 @@ fn compile_unit_metadata(cx: &CrateContext) {
                             // prepend "./" if necessary
                             let dotdot = bytes!("..");
                             let prefix = &[dotdot[0], ::std::path::SEP_BYTE];
-                            let mut path_bytes = p.as_vec().to_owned();
+                            let mut path_bytes = Vec::from_slice(p.as_vec());
 
                             if path_bytes.slice_to(2) != prefix &&
                                path_bytes.slice_to(2) != dotdot {
@@ -969,7 +968,7 @@ fn compile_unit_metadata(cx: &CrateContext) {
                                 path_bytes.insert(1, prefix[1]);
                             }
 
-                            path_bytes.to_c_str()
+                            path_bytes.as_slice().to_c_str()
                         }
                     _ => fallback_path(cx)
                 }
diff --git a/src/librustc/middle/trans/expr.rs b/src/librustc/middle/trans/expr.rs
index e19408520f6..ba050e8db33 100644
--- a/src/librustc/middle/trans/expr.rs
+++ b/src/librustc/middle/trans/expr.rs
@@ -71,7 +71,6 @@ use util::nodemap::NodeMap;
 use middle::trans::machine::{llsize_of, llsize_of_alloc};
 use middle::trans::type_::Type;
 
-use std::slice;
 use syntax::ast;
 use syntax::codemap;
 use syntax::print::pprust::{expr_to_str};
@@ -969,7 +968,7 @@ fn trans_rec_or_struct<'a>(
     let ty = node_id_type(bcx, id);
     let tcx = bcx.tcx();
     with_field_tys(tcx, ty, Some(id), |discr, field_tys| {
-        let mut need_base = slice::from_elem(field_tys.len(), true);
+        let mut need_base = Vec::from_elem(field_tys.len(), true);
 
         let numbered_fields = fields.iter().map(|field| {
             let opt_pos =
@@ -977,7 +976,7 @@ fn trans_rec_or_struct<'a>(
                                           field_ty.ident.name == field.ident.node.name);
             match opt_pos {
                 Some(i) => {
-                    need_base[i] = false;
+                    *need_base.get_mut(i) = false;
                     (i, field.expr)
                 }
                 None => {
diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs
index 6770640cfac..b2529e44026 100644
--- a/src/librustc/middle/typeck/check/mod.rs
+++ b/src/librustc/middle/typeck/check/mod.rs
@@ -118,7 +118,6 @@ use std::cell::{Cell, RefCell};
 use collections::HashMap;
 use std::mem::replace;
 use std::result;
-use std::slice;
 use std::vec::Vec;
 use syntax::abi;
 use syntax::ast::{Provided, Required};
@@ -3906,13 +3905,13 @@ pub fn check_bounds_are_used(ccx: &CrateCtxt,
 
     // make a vector of booleans initially false, set to true when used
     if tps.len() == 0u { return; }
-    let mut tps_used = slice::from_elem(tps.len(), false);
+    let mut tps_used = Vec::from_elem(tps.len(), false);
 
     ty::walk_ty(ty, |t| {
             match ty::get(t).sty {
                 ty::ty_param(param_ty {idx, ..}) => {
                     debug!("Found use of ty param \\#{}", idx);
-                    tps_used[idx] = true;
+                    *tps_used.get_mut(idx) = true;
                 }
                 _ => ()
             }
diff --git a/src/librustc/middle/typeck/infer/region_inference/mod.rs b/src/librustc/middle/typeck/infer/region_inference/mod.rs
index 03b2ebcc245..a446b94027b 100644
--- a/src/librustc/middle/typeck/infer/region_inference/mod.rs
+++ b/src/librustc/middle/typeck/infer/region_inference/mod.rs
@@ -26,7 +26,6 @@ use util::ppaux::{Repr};
 
 use std::cell::{Cell, RefCell};
 use std::uint;
-use std::slice;
 use collections::{HashMap, HashSet};
 use syntax::ast;
 
@@ -1004,7 +1003,7 @@ impl<'a> RegionVarBindings<'a> {
         // idea is to report errors that derive from independent
         // regions of the graph, but not those that derive from
         // overlapping locations.
-        let mut dup_vec = slice::from_elem(self.num_vars(), uint::MAX);
+        let mut dup_vec = Vec::from_elem(self.num_vars(), uint::MAX);
 
         let mut opt_graph = None;
 
@@ -1052,11 +1051,13 @@ impl<'a> RegionVarBindings<'a> {
                     match var_data[idx].classification {
                         Expanding => {
                             self.collect_error_for_expanding_node(
-                                graph, var_data, dup_vec, node_vid, errors);
+                                graph, var_data, dup_vec.as_mut_slice(),
+                                node_vid, errors);
                         }
                         Contracting => {
                             self.collect_error_for_contracting_node(
-                                graph, var_data, dup_vec, node_vid, errors);
+                                graph, var_data, dup_vec.as_mut_slice(),
+                                node_vid, errors);
                         }
                     }
                 }
diff --git a/src/librustc/util/sha2.rs b/src/librustc/util/sha2.rs
index 4571e6328cf..8fba8589d4d 100644
--- a/src/librustc/util/sha2.rs
+++ b/src/librustc/util/sha2.rs
@@ -525,7 +525,6 @@ mod tests {
 
     use super::{Digest, Sha256, FixedBuffer};
     use std::num::Bounded;
-    use std::slice;
     use self::rand::isaac::IsaacRng;
     use self::rand::Rng;
     use serialize::hex::FromHex;
@@ -600,7 +599,7 @@ mod tests {
     /// correct.
     fn test_digest_1million_random<D: Digest>(digest: &mut D, blocksize: uint, expected: &str) {
         let total_size = 1000000;
-        let buffer = slice::from_elem(blocksize * 2, 'a' as u8);
+        let buffer = Vec::from_elem(blocksize * 2, 'a' as u8);
         let mut rng = IsaacRng::new_unseeded();
         let mut count = 0;
 
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index f842c44dec8..1fb43c34b4e 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -38,7 +38,6 @@ use std::fmt;
 use std::io::{fs, File, BufferedWriter, MemWriter, BufferedReader};
 use std::io;
 use std::local_data;
-use std::slice;
 use std::str;
 use std::strbuf::StrBuf;
 
@@ -1047,7 +1046,7 @@ fn item_module(w: &mut Writer, cx: &Context,
                item: &clean::Item, items: &[clean::Item]) -> fmt::Result {
     try!(document(w, item));
     debug!("{:?}", items);
-    let mut indices = slice::from_fn(items.len(), |i| i);
+    let mut indices = Vec::from_fn(items.len(), |i| i);
 
     fn cmp(i1: &clean::Item, i2: &clean::Item, idx1: uint, idx2: uint) -> Ordering {
         if shortty(i1) == shortty(i2) {
diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs
index ad49f41f64a..30582fb0e41 100644
--- a/src/librustdoc/test.rs
+++ b/src/librustdoc/test.rs
@@ -169,8 +169,8 @@ fn runtest(test: &str, cratename: &str, libs: HashSet<Path>, should_fail: bool,
 
 fn maketest(s: &str, cratename: &str, loose_feature_gating: bool) -> ~str {
     let mut prog = StrBuf::from_str(r"
-#![deny(warnings)];
-#![allow(unused_variable, dead_assignment, unused_mut, attribute_usage, dead_code)];
+#![deny(warnings)]
+#![allow(unused_variable, dead_assignment, unused_mut, attribute_usage, dead_code)]
 ");
 
     if loose_feature_gating {
diff --git a/src/librustuv/addrinfo.rs b/src/librustuv/addrinfo.rs
index 1621435de55..94a084fe055 100644
--- a/src/librustuv/addrinfo.rs
+++ b/src/librustuv/addrinfo.rs
@@ -138,7 +138,7 @@ pub fn accum_addrinfo(addr: &Addrinfo) -> ~[ai::Info] {
     unsafe {
         let mut addr = addr.handle;
 
-        let mut addrs = ~[];
+        let mut addrs = Vec::new();
         loop {
             let rustaddr = net::sockaddr_to_addr(cast::transmute((*addr).ai_addr),
                                                  (*addr).ai_addrlen as uint);
@@ -180,6 +180,6 @@ pub fn accum_addrinfo(addr: &Addrinfo) -> ~[ai::Info] {
             }
         }
 
-        return addrs;
+        return addrs.move_iter().collect();
     }
 }
diff --git a/src/librustuv/file.rs b/src/librustuv/file.rs
index 69be32a6021..cde5cfa97c1 100644
--- a/src/librustuv/file.rs
+++ b/src/librustuv/file.rs
@@ -469,7 +469,6 @@ mod test {
     use libc::{O_CREAT, O_RDWR, O_RDONLY, S_IWUSR, S_IRUSR};
     use std::io;
     use std::str;
-    use std::slice;
     use super::FsRequest;
     use super::super::Loop;
     use super::super::local_loop;
@@ -505,8 +504,8 @@ mod test {
             let fd = result.fd;
 
             // read
-            let mut read_mem = slice::from_elem(1000, 0u8);
-            let result = FsRequest::read(l(), fd, read_mem, 0);
+            let mut read_mem = Vec::from_elem(1000, 0u8);
+            let result = FsRequest::read(l(), fd, read_mem.as_mut_slice(), 0);
             assert!(result.is_ok());
 
             let nread = result.unwrap();
diff --git a/src/librustuv/process.rs b/src/librustuv/process.rs
index c0db66cb913..7b5b5d3235b 100644
--- a/src/librustuv/process.rs
+++ b/src/librustuv/process.rs
@@ -15,7 +15,6 @@ use libc;
 use std::ptr;
 use std::rt::rtio::RtioProcess;
 use std::rt::task::BlockedTask;
-use std::slice;
 
 use homing::{HomingIO, HomeHandle};
 use pipe::PipeWatcher;
@@ -44,12 +43,12 @@ impl Process {
                 -> Result<(~Process, ~[Option<PipeWatcher>]), UvError>
     {
         let cwd = config.cwd.map(|s| s.to_c_str());
-        let mut io = ~[config.stdin, config.stdout, config.stderr];
+        let mut io = vec![config.stdin, config.stdout, config.stderr];
         for slot in config.extra_io.iter() {
             io.push(*slot);
         }
-        let mut stdio = slice::with_capacity::<uvll::uv_stdio_container_t>(io.len());
-        let mut ret_io = slice::with_capacity(io.len());
+        let mut stdio = Vec::<uvll::uv_stdio_container_t>::with_capacity(io.len());
+        let mut ret_io = Vec::with_capacity(io.len());
         unsafe {
             stdio.set_len(io.len());
             for (slot, other) in stdio.iter().zip(io.iter()) {
@@ -104,7 +103,7 @@ impl Process {
         });
 
         match ret {
-            Ok(p) => Ok((p, ret_io)),
+            Ok(p) => Ok((p, ret_io.move_iter().collect())),
             Err(e) => Err(e),
         }
     }
@@ -167,14 +166,14 @@ unsafe fn set_stdio(dst: *uvll::uv_stdio_container_t,
 fn with_argv<T>(prog: &str, args: &[~str], f: |**libc::c_char| -> T) -> T {
     // First, allocation space to put all the C-strings (we need to have
     // ownership of them somewhere
-    let mut c_strs = slice::with_capacity(args.len() + 1);
+    let mut c_strs = Vec::with_capacity(args.len() + 1);
     c_strs.push(prog.to_c_str());
     for arg in args.iter() {
         c_strs.push(arg.to_c_str());
     }
 
     // Next, create the char** array
-    let mut c_args = slice::with_capacity(c_strs.len() + 1);
+    let mut c_args = Vec::with_capacity(c_strs.len() + 1);
     for s in c_strs.iter() {
         c_args.push(s.with_ref(|p| p));
     }
@@ -189,11 +188,11 @@ fn with_env<T>(env: Option<&[(~str, ~str)]>, f: |**libc::c_char| -> T) -> T {
         None => { return f(ptr::null()); }
     };
     // As with argv, create some temporary storage and then the actual array
-    let mut envp = slice::with_capacity(env.len());
+    let mut envp = Vec::with_capacity(env.len());
     for &(ref key, ref value) in env.iter() {
         envp.push(format!("{}={}", *key, *value).to_c_str());
     }
-    let mut c_envp = slice::with_capacity(envp.len() + 1);
+    let mut c_envp = Vec::with_capacity(envp.len() + 1);
     for s in envp.iter() {
         c_envp.push(s.with_ref(|p| p));
     }
diff --git a/src/libserialize/base64.rs b/src/libserialize/base64.rs
index 5a780b06e8a..92622e6c59f 100644
--- a/src/libserialize/base64.rs
+++ b/src/libserialize/base64.rs
@@ -79,7 +79,7 @@ impl<'a> ToBase64 for &'a [u8] {
             UrlSafe => URLSAFE_CHARS
         };
 
-        let mut v: ~[u8] = ~[];
+        let mut v = Vec::new();
         let mut i = 0;
         let mut cur_length = 0;
         let len = self.len();
@@ -146,7 +146,7 @@ impl<'a> ToBase64 for &'a [u8] {
         }
 
         unsafe {
-            str::raw::from_utf8_owned(v)
+            str::raw::from_utf8_owned(v.move_iter().collect())
         }
     }
 }
@@ -208,7 +208,7 @@ impl<'a> FromBase64 for &'a str {
      * ```
      */
     fn from_base64(&self) -> Result<~[u8], FromBase64Error> {
-        let mut r = ~[];
+        let mut r = Vec::new();
         let mut buf: u32 = 0;
         let mut modulus = 0;
 
@@ -256,7 +256,7 @@ impl<'a> FromBase64 for &'a str {
             _ => return Err(InvalidBase64Length),
         }
 
-        Ok(r)
+        Ok(r.move_iter().collect())
     }
 }
 
@@ -337,12 +337,12 @@ mod tests {
     #[test]
     fn test_base64_random() {
         use self::rand::{task_rng, random, Rng};
-        use std::slice;
 
         for _ in range(0, 1000) {
             let times = task_rng().gen_range(1u, 100);
-            let v = slice::from_fn(times, |_| random::<u8>());
-            assert_eq!(v.to_base64(STANDARD).from_base64().unwrap(), v);
+            let v = Vec::from_fn(times, |_| random::<u8>());
+            assert_eq!(v.as_slice().to_base64(STANDARD).from_base64().unwrap(),
+                       v.as_slice().to_owned());
         }
     }
 
diff --git a/src/libserialize/ebml.rs b/src/libserialize/ebml.rs
index 0efa93011fc..486150f1741 100644
--- a/src/libserialize/ebml.rs
+++ b/src/libserialize/ebml.rs
@@ -1099,8 +1099,7 @@ mod bench {
 
     #[bench]
     pub fn vuint_at_A_aligned(b: &mut Bencher) {
-        use std::slice;
-        let data = slice::from_fn(4*100, |i| {
+        let data = Vec::from_fn(4*100, |i| {
             match i % 2 {
               0 => 0x80u8,
               _ => i as u8,
@@ -1110,7 +1109,7 @@ mod bench {
         b.iter(|| {
             let mut i = 0;
             while i < data.len() {
-                sum += reader::vuint_at(data, i).unwrap().val;
+                sum += reader::vuint_at(data.as_slice(), i).unwrap().val;
                 i += 4;
             }
         });
@@ -1118,8 +1117,7 @@ mod bench {
 
     #[bench]
     pub fn vuint_at_A_unaligned(b: &mut Bencher) {
-        use std::slice;
-        let data = slice::from_fn(4*100+1, |i| {
+        let data = Vec::from_fn(4*100+1, |i| {
             match i % 2 {
               1 => 0x80u8,
               _ => i as u8
@@ -1129,7 +1127,7 @@ mod bench {
         b.iter(|| {
             let mut i = 1;
             while i < data.len() {
-                sum += reader::vuint_at(data, i).unwrap().val;
+                sum += reader::vuint_at(data.as_slice(), i).unwrap().val;
                 i += 4;
             }
         });
@@ -1137,8 +1135,7 @@ mod bench {
 
     #[bench]
     pub fn vuint_at_D_aligned(b: &mut Bencher) {
-        use std::slice;
-        let data = slice::from_fn(4*100, |i| {
+        let data = Vec::from_fn(4*100, |i| {
             match i % 4 {
               0 => 0x10u8,
               3 => i as u8,
@@ -1149,7 +1146,7 @@ mod bench {
         b.iter(|| {
             let mut i = 0;
             while i < data.len() {
-                sum += reader::vuint_at(data, i).unwrap().val;
+                sum += reader::vuint_at(data.as_slice(), i).unwrap().val;
                 i += 4;
             }
         });
@@ -1157,8 +1154,7 @@ mod bench {
 
     #[bench]
     pub fn vuint_at_D_unaligned(b: &mut Bencher) {
-        use std::slice;
-        let data = slice::from_fn(4*100+1, |i| {
+        let data = Vec::from_fn(4*100+1, |i| {
             match i % 4 {
               1 => 0x10u8,
               0 => i as u8,
@@ -1169,7 +1165,7 @@ mod bench {
         b.iter(|| {
             let mut i = 1;
             while i < data.len() {
-                sum += reader::vuint_at(data, i).unwrap().val;
+                sum += reader::vuint_at(data.as_slice(), i).unwrap().val;
                 i += 4;
             }
         });
diff --git a/src/libserialize/hex.rs b/src/libserialize/hex.rs
index 3584b19843b..fa383bef2dc 100644
--- a/src/libserialize/hex.rs
+++ b/src/libserialize/hex.rs
@@ -10,7 +10,6 @@
 
 //! Hex binary-to-text encoding
 use std::str;
-use std::slice;
 use std::fmt;
 
 /// A trait for converting a value to hexadecimal encoding
@@ -39,14 +38,14 @@ impl<'a> ToHex for &'a [u8] {
      * ```
      */
     fn to_hex(&self) -> ~str {
-        let mut v = slice::with_capacity(self.len() * 2);
+        let mut v = Vec::with_capacity(self.len() * 2);
         for &byte in self.iter() {
             v.push(CHARS[(byte >> 4) as uint]);
             v.push(CHARS[(byte & 0xf) as uint]);
         }
 
         unsafe {
-            str::raw::from_utf8_owned(v)
+            str::raw::from_utf8_owned(v.move_iter().collect())
         }
     }
 }
@@ -106,7 +105,7 @@ impl<'a> FromHex for &'a str {
      */
     fn from_hex(&self) -> Result<~[u8], FromHexError> {
         // This may be an overestimate if there is any whitespace
-        let mut b = slice::with_capacity(self.len() / 2);
+        let mut b = Vec::with_capacity(self.len() / 2);
         let mut modulus = 0;
         let mut buf = 0u8;
 
@@ -132,7 +131,7 @@ impl<'a> FromHex for &'a str {
         }
 
         match modulus {
-            0 => Ok(b),
+            0 => Ok(b.move_iter().collect()),
             _ => Err(InvalidHexLength),
         }
     }
diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs
index 02afdb713ff..606f2b12af1 100644
--- a/src/libserialize/json.rs
+++ b/src/libserialize/json.rs
@@ -1230,11 +1230,11 @@ impl<T : Iterator<char>> Parser<T> {
         self.bump();
         self.parse_whitespace();
 
-        let mut values = ~[];
+        let mut values = Vec::new();
 
         if self.ch_is(']') {
             self.bump();
-            return Ok(List(values));
+            return Ok(List(values.move_iter().collect()));
         }
 
         loop {
@@ -1252,7 +1252,7 @@ impl<T : Iterator<char>> Parser<T> {
                 self.bump();
             } else if self.ch_is(']') {
                 self.bump();
-                return Ok(List(values));
+                return Ok(List(values.move_iter().collect()));
             } else {
                 return self.error(~"expected `,` or `]`")
             }
@@ -1332,14 +1332,14 @@ pub fn from_str(s: &str) -> DecodeResult<Json> {
 
 /// A structure to decode JSON to values in rust.
 pub struct Decoder {
-    stack: ~[Json],
+    stack: Vec<Json>,
 }
 
 impl Decoder {
     /// Creates a new decoder instance for decoding the specified JSON value.
     pub fn new(json: Json) -> Decoder {
         Decoder {
-            stack: ~[json]
+            stack: vec!(json),
         }
     }
 }
diff --git a/src/libserialize/serialize.rs b/src/libserialize/serialize.rs
index 6cda8d9ffb5..09b30077f6f 100644
--- a/src/libserialize/serialize.rs
+++ b/src/libserialize/serialize.rs
@@ -16,7 +16,6 @@ Core encoding and decoding interfaces.
 
 use std::path;
 use std::rc::Rc;
-use std::slice;
 
 pub trait Encoder<E> {
     // Primitive types:
@@ -443,11 +442,15 @@ impl<E, S:Encoder<E>,T:Encodable<S, E>> Encodable<S, E> for ~[T] {
 impl<E, D:Decoder<E>,T:Decodable<D, E>> Decodable<D, E> for ~[T] {
     fn decode(d: &mut D) -> Result<~[T], E> {
         d.read_seq(|d, len| {
-            let mut v: ~[T] = slice::with_capacity(len);
+            let mut v: Vec<T> = Vec::with_capacity(len);
             for i in range(0, len) {
                 v.push(try!(d.read_seq_elt(i, |d| Decodable::decode(d))));
             }
-            Ok(v)
+            println!("-------");
+            println!("{}", v.len());
+            let k = v.move_iter().collect::<~[T]>();
+            println!("{}", k.len());
+            Ok(k)
         })
     }
 }
@@ -594,11 +597,11 @@ pub trait DecoderHelpers<E> {
 impl<E, D:Decoder<E>> DecoderHelpers<E> for D {
     fn read_to_vec<T>(&mut self, f: |&mut D| -> Result<T, E>) -> Result<~[T], E> {
         self.read_seq(|this, len| {
-            let mut v = slice::with_capacity(len);
+            let mut v = Vec::with_capacity(len);
             for i in range(0, len) {
                 v.push(try!(this.read_seq_elt(i, |this| f(this))));
             }
-            Ok(v)
+            Ok(v.move_iter().collect())
         })
     }
 }
diff --git a/src/libstd/comm/shared.rs b/src/libstd/comm/shared.rs
index 525786f5d1e..c0f1aeae26b 100644
--- a/src/libstd/comm/shared.rs
+++ b/src/libstd/comm/shared.rs
@@ -30,7 +30,6 @@ use rt::task::{Task, BlockedTask};
 use rt::thread::Thread;
 use sync::atomics;
 use unstable::mutex::NativeMutex;
-use slice::OwnedVector;
 
 use mpsc = sync::mpsc_queue;
 
diff --git a/src/libstd/comm/stream.rs b/src/libstd/comm/stream.rs
index 6c9280e0abc..44070dc4460 100644
--- a/src/libstd/comm/stream.rs
+++ b/src/libstd/comm/stream.rs
@@ -30,7 +30,6 @@ use rt::task::{Task, BlockedTask};
 use rt::thread::Thread;
 use spsc = sync::spsc_queue;
 use sync::atomics;
-use slice::OwnedVector;
 
 static DISCONNECTED: int = int::MIN;
 #[cfg(test)]
diff --git a/src/libstd/hash/sip.rs b/src/libstd/hash/sip.rs
index 9afb7124c4b..eee8e416231 100644
--- a/src/libstd/hash/sip.rs
+++ b/src/libstd/hash/sip.rs
@@ -359,13 +359,8 @@ pub fn hash_with_keys<T: Hash<SipState>>(k0: u64, k1: u64, value: &T) -> u64 {
 #[cfg(test)]
 mod tests {
     extern crate test;
-    use io::Writer;
-    use iter::Iterator;
+    use prelude::*;
     use num::ToStrRadix;
-    use option::{Some, None};
-    use str::Str;
-    use strbuf::StrBuf;
-    use slice::{Vector, ImmutableVector, OwnedVector};
     use self::test::Bencher;
 
     use super::super::Hash;
@@ -454,7 +449,7 @@ mod tests {
 
         let k0 = 0x_07_06_05_04_03_02_01_00_u64;
         let k1 = 0x_0f_0e_0d_0c_0b_0a_09_08_u64;
-        let mut buf : ~[u8] = ~[];
+        let mut buf = Vec::new();
         let mut t = 0;
         let mut state_inc = SipState::new_with_keys(k0, k1);
         let mut state_full = SipState::new_with_keys(k0, k1);
@@ -496,7 +491,7 @@ mod tests {
             assert_eq!(vec, out);
 
             state_full.reset();
-            state_full.write(buf);
+            state_full.write(buf.as_slice());
             let f = result_str(state_full.result());
             let i = result_str(state_inc.result());
             let v = to_hex_str(&vecs[t]);
diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs
index e7d0c03551f..c541eb91d06 100644
--- a/src/libstd/io/buffered.rs
+++ b/src/libstd/io/buffered.rs
@@ -17,7 +17,7 @@ use iter::ExactSize;
 use ops::Drop;
 use option::{Some, None, Option};
 use result::{Ok, Err};
-use slice::{OwnedVector, ImmutableVector, MutableVector};
+use slice::{ImmutableVector, MutableVector};
 use slice;
 use vec::Vec;
 
@@ -391,7 +391,7 @@ mod test {
 
     /// A dummy reader intended at testing short-reads propagation.
     pub struct ShortReader {
-        lengths: ~[uint],
+        lengths: Vec<uint>,
     }
 
     impl Reader for ShortReader {
@@ -554,7 +554,7 @@ mod test {
 
     #[test]
     fn test_short_reads() {
-        let inner = ShortReader{lengths: ~[0, 1, 2, 0, 1, 0]};
+        let inner = ShortReader{lengths: vec![0, 1, 2, 0, 1, 0]};
         let mut reader = BufferedReader::new(inner);
         let mut buf = [0, 0];
         assert_eq!(reader.read(buf), Ok(0));
diff --git a/src/libstd/io/extensions.rs b/src/libstd/io/extensions.rs
index d8022b1e26c..955d4c07d28 100644
--- a/src/libstd/io/extensions.rs
+++ b/src/libstd/io/extensions.rs
@@ -21,7 +21,7 @@ use option::{Option, Some, None};
 use result::{Ok, Err};
 use io;
 use io::{IoError, IoResult, Reader};
-use slice::{OwnedVector, ImmutableVector, Vector};
+use slice::{ImmutableVector, Vector};
 use ptr::RawPtr;
 
 /// An iterator that reads a single byte on each iteration,
@@ -503,21 +503,22 @@ mod test {
 #[cfg(test)]
 mod bench {
     extern crate test;
-    use self::test::Bencher;
+
     use container::Container;
+    use prelude::*;
+    use self::test::Bencher;
 
     macro_rules! u64_from_be_bytes_bench_impl(
         ($size:expr, $stride:expr, $start_index:expr) =>
         ({
-            use slice;
             use super::u64_from_be_bytes;
 
-            let data = slice::from_fn($stride*100+$start_index, |i| i as u8);
+            let data = Vec::from_fn($stride*100+$start_index, |i| i as u8);
             let mut sum = 0u64;
             b.iter(|| {
                 let mut i = $start_index;
                 while i < data.len() {
-                    sum += u64_from_be_bytes(data, i, $size);
+                    sum += u64_from_be_bytes(data.as_slice(), i, $size);
                     i += $stride;
                 }
             });
diff --git a/src/libstd/io/mem.rs b/src/libstd/io/mem.rs
index 36e29700c5d..aa3820bcd1f 100644
--- a/src/libstd/io/mem.rs
+++ b/src/libstd/io/mem.rs
@@ -17,7 +17,7 @@ use result::{Err, Ok};
 use io;
 use io::{Reader, Writer, Seek, Buffer, IoError, SeekStyle, IoResult};
 use slice;
-use slice::{Vector, ImmutableVector, MutableVector, OwnedCloneableVector};
+use slice::{Vector, ImmutableVector, MutableVector};
 use vec::Vec;
 
 fn combine(seek: SeekStyle, cur: uint, end: uint, offset: i64) -> IoResult<u64> {
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs
index 0ee2da7bb70..6864f18d26c 100644
--- a/src/libstd/io/mod.rs
+++ b/src/libstd/io/mod.rs
@@ -228,11 +228,11 @@ use os;
 use option::{Option, Some, None};
 use path::Path;
 use result::{Ok, Err, Result};
-use str::{StrSlice, OwnedStr};
+use str::StrSlice;
 use str;
 use uint;
 use unstable::finally::try_finally;
-use slice::{Vector, OwnedVector, MutableVector, ImmutableVector, OwnedCloneableVector};
+use slice::{Vector, MutableVector, ImmutableVector};
 use vec::Vec;
 
 // Reexports
diff --git a/src/libstd/io/process.rs b/src/libstd/io/process.rs
index f0b96e2e76c..26ead9e1e53 100644
--- a/src/libstd/io/process.rs
+++ b/src/libstd/io/process.rs
@@ -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();
     }
diff --git a/src/libstd/io/signal.rs b/src/libstd/io/signal.rs
index d3f3d888b87..e7dae59acb8 100644
--- a/src/libstd/io/signal.rs
+++ b/src/libstd/io/signal.rs
@@ -28,7 +28,7 @@ use mem::drop;
 use option::{Some, None};
 use result::{Ok, Err};
 use rt::rtio::{IoFactory, LocalIo, RtioSignal};
-use slice::{ImmutableVector, OwnedVector};
+use slice::ImmutableVector;
 use vec::Vec;
 
 /// Signals that can be sent and received
diff --git a/src/libstd/local_data.rs b/src/libstd/local_data.rs
index c76e079432a..78a66f1f762 100644
--- a/src/libstd/local_data.rs
+++ b/src/libstd/local_data.rs
@@ -46,7 +46,7 @@ use kinds::Send;
 use mem::replace;
 use option::{None, Option, Some};
 use rt::task::{Task, LocalStorage};
-use slice::{ImmutableVector, MutableVector, OwnedVector};
+use slice::{ImmutableVector, MutableVector};
 use vec::Vec;
 
 /**
diff --git a/src/libstd/num/int_macros.rs b/src/libstd/num/int_macros.rs
index 1d2c38f22bb..3228b5a1a49 100644
--- a/src/libstd/num/int_macros.rs
+++ b/src/libstd/num/int_macros.rs
@@ -277,13 +277,13 @@ impl ToStrRadix for $T {
     /// Convert to a string in a given base.
     #[inline]
     fn to_str_radix(&self, radix: uint) -> ~str {
-        let mut buf: ~[u8] = ~[];
+        let mut buf = Vec::new();
         strconv::int_to_str_bytes_common(*self, radix, strconv::SignNeg, |i| {
             buf.push(i);
         });
         // We know we generated valid utf-8, so we don't need to go through that
         // check.
-        unsafe { str::raw::from_utf8_owned(buf) }
+        unsafe { str::raw::from_utf8_owned(buf.move_iter().collect()) }
     }
 }
 
diff --git a/src/libstd/num/mod.rs b/src/libstd/num/mod.rs
index 7ddefe9a63d..12befed743a 100644
--- a/src/libstd/num/mod.rs
+++ b/src/libstd/num/mod.rs
@@ -1779,12 +1779,11 @@ mod bench {
     extern crate test;
     use self::test::Bencher;
     use num;
-    use slice;
     use prelude::*;
 
     #[bench]
     fn bench_pow_function(b: &mut Bencher) {
-        let v = slice::from_fn(1024, |n| n);
+        let v = Vec::from_fn(1024, |n| n);
         b.iter(|| {v.iter().fold(0, |old, new| num::pow(old, *new));});
     }
 }
diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs
index 3ce9a3d0764..ffcb129d635 100644
--- a/src/libstd/num/strconv.rs
+++ b/src/libstd/num/strconv.rs
@@ -10,19 +10,21 @@
 
 #![allow(missing_doc)]
 
+use char;
 use clone::Clone;
 use container::Container;
-use std::cmp::{Ord, Eq};
+use iter::Iterator;
+use num::{NumCast, Zero, One, cast, Int};
+use num::{Round, Float, FPNaN, FPInfinite, ToPrimitive};
+use num;
 use ops::{Add, Sub, Mul, Div, Rem, Neg};
 use option::{None, Option, Some};
-use char;
+use slice::OwnedVector;
+use slice::{CloneableVector, ImmutableVector, MutableVector};
+use std::cmp::{Ord, Eq};
 use str::{StrSlice};
 use str;
-use slice::{CloneableVector, ImmutableVector, MutableVector};
-use slice::OwnedVector;
-use num;
-use num::{NumCast, Zero, One, cast, Int};
-use num::{Round, Float, FPNaN, FPInfinite, ToPrimitive};
+use vec::Vec;
 
 /// A flag that specifies whether to use exponential (scientific) notation.
 pub enum ExponentFormat {
@@ -293,7 +295,7 @@ pub fn float_to_str_bytes_common<T:NumCast+Zero+One+Eq+Ord+Float+Round+
     }
 
     let neg = num < _0 || (negative_zero && _1 / num == Float::neg_infinity());
-    let mut buf: ~[u8] = ~[];
+    let mut buf = Vec::new();
     let radix_gen: T   = cast(radix as int).unwrap();
 
     let (num, exp) = match exp_format {
@@ -411,23 +413,23 @@ pub fn float_to_str_bytes_common<T:NumCast+Zero+One+Eq+Ord+Float+Round+
                     // If reached left end of number, have to
                     // insert additional digit:
                     if i < 0
-                    || buf[i as uint] == '-' as u8
-                    || buf[i as uint] == '+' as u8 {
+                    || *buf.get(i as uint) == '-' as u8
+                    || *buf.get(i as uint) == '+' as u8 {
                         buf.insert((i + 1) as uint, value2ascii(1));
                         break;
                     }
 
                     // Skip the '.'
-                    if buf[i as uint] == '.' as u8 { i -= 1; continue; }
+                    if *buf.get(i as uint) == '.' as u8 { i -= 1; continue; }
 
                     // Either increment the digit,
                     // or set to 0 if max and carry the 1.
-                    let current_digit = ascii2value(buf[i as uint]);
+                    let current_digit = ascii2value(*buf.get(i as uint));
                     if current_digit < (radix - 1) {
-                        buf[i as uint] = value2ascii(current_digit+1);
+                        *buf.get_mut(i as uint) = value2ascii(current_digit+1);
                         break;
                     } else {
-                        buf[i as uint] = value2ascii(0);
+                        *buf.get_mut(i as uint) = value2ascii(0);
                         i -= 1;
                     }
                 }
@@ -444,25 +446,25 @@ pub fn float_to_str_bytes_common<T:NumCast+Zero+One+Eq+Ord+Float+Round+
         let mut i = buf_max_i;
 
         // discover trailing zeros of fractional part
-        while i > start_fractional_digits && buf[i] == '0' as u8 {
+        while i > start_fractional_digits && *buf.get(i) == '0' as u8 {
             i -= 1;
         }
 
         // Only attempt to truncate digits if buf has fractional digits
         if i >= start_fractional_digits {
             // If buf ends with '.', cut that too.
-            if buf[i] == '.' as u8 { i -= 1 }
+            if *buf.get(i) == '.' as u8 { i -= 1 }
 
             // only resize buf if we actually remove digits
             if i < buf_max_i {
-                buf = buf.slice(0, i + 1).to_owned();
+                buf = Vec::from_slice(buf.slice(0, i + 1));
             }
         }
     } // If exact and trailing '.', just cut that
     else {
         let max_i = buf.len() - 1;
-        if buf[max_i] == '.' as u8 {
-            buf = buf.slice(0, max_i).to_owned();
+        if *buf.get(max_i) == '.' as u8 {
+            buf = Vec::from_slice(buf.slice(0, max_i));
         }
     }
 
@@ -481,7 +483,7 @@ pub fn float_to_str_bytes_common<T:NumCast+Zero+One+Eq+Ord+Float+Round+
         }
     }
 
-    (buf, false)
+    (buf.move_iter().collect(), false)
 }
 
 /**
diff --git a/src/libstd/num/uint_macros.rs b/src/libstd/num/uint_macros.rs
index ece30e72e06..61723f339ae 100644
--- a/src/libstd/num/uint_macros.rs
+++ b/src/libstd/num/uint_macros.rs
@@ -191,13 +191,13 @@ impl ToStrRadix for $T {
     /// Convert to a string in a given base.
     #[inline]
     fn to_str_radix(&self, radix: uint) -> ~str {
-        let mut buf = ~[];
+        let mut buf = Vec::new();
         strconv::int_to_str_bytes_common(*self, radix, strconv::SignNone, |i| {
             buf.push(i);
         });
         // We know we generated valid utf-8, so we don't need to go through that
         // check.
-        unsafe { str::raw::from_utf8_owned(buf) }
+        unsafe { str::raw::from_utf8_owned(buf.move_iter().collect()) }
     }
 }
 
diff --git a/src/libstd/os.rs b/src/libstd/os.rs
index 25f503174bc..dbb95304873 100644
--- a/src/libstd/os.rs
+++ b/src/libstd/os.rs
@@ -28,10 +28,6 @@
 
 #![allow(missing_doc)]
 
-#[cfg(target_os = "macos")]
-#[cfg(windows)]
-use iter::range;
-
 use clone::Clone;
 use container::Container;
 use libc;
@@ -49,6 +45,7 @@ use path::{Path, GenericPath};
 use iter::Iterator;
 use slice::{Vector, CloneableVector, ImmutableVector, MutableVector, OwnedVector};
 use ptr::RawPtr;
+use vec::Vec;
 
 #[cfg(unix)]
 use c_str::ToCStr;
@@ -96,15 +93,16 @@ pub fn getcwd() -> Path {
 
 #[cfg(windows)]
 pub mod win32 {
+    use iter::Iterator;
     use libc::types::os::arch::extra::DWORD;
     use libc;
     use option::{None, Option};
     use option;
     use os::TMPBUF_SZ;
+    use slice::{MutableVector, ImmutableVector, OwnedVector};
     use str::StrSlice;
     use str;
-    use slice::{MutableVector, ImmutableVector, OwnedVector};
-    use slice;
+    use vec::Vec;
 
     pub fn fill_utf16_buf_and_decode(f: |*mut u16, DWORD| -> DWORD)
         -> Option<~str> {
@@ -114,7 +112,7 @@ pub mod win32 {
             let mut res = None;
             let mut done = false;
             while !done {
-                let mut buf = slice::from_elem(n as uint, 0u16);
+                let mut buf = Vec::from_elem(n as uint, 0u16);
                 let k = f(buf.as_mut_ptr(), n);
                 if k == (0 as DWORD) {
                     done = true;
@@ -142,7 +140,7 @@ pub mod win32 {
     }
 
     pub fn as_utf16_p<T>(s: &str, f: |*u16| -> T) -> T {
-        let mut t = s.to_utf16();
+        let mut t = s.to_utf16().move_iter().collect::<Vec<u16>>();
         // Null terminate before passing on.
         t.push(0u16);
         f(t.as_ptr())
@@ -182,7 +180,7 @@ pub fn env() -> ~[(~str,~str)] {
 pub fn env_as_bytes() -> ~[(~[u8],~[u8])] {
     unsafe {
         #[cfg(windows)]
-        unsafe fn get_env_pairs() -> ~[~[u8]] {
+        unsafe fn get_env_pairs() -> Vec<~[u8]> {
             use c_str;
             use str::StrSlice;
 
@@ -195,7 +193,7 @@ pub fn env_as_bytes() -> ~[(~[u8],~[u8])] {
                 fail!("os::env() failure getting env string from OS: {}",
                        os::last_os_error());
             }
-            let mut result = ~[];
+            let mut result = Vec::new();
             c_str::from_c_multistring(ch as *c_char, None, |cstr| {
                 result.push(cstr.as_bytes_no_nul().to_owned());
             });
@@ -203,7 +201,7 @@ pub fn env_as_bytes() -> ~[(~[u8],~[u8])] {
             result
         }
         #[cfg(unix)]
-        unsafe fn get_env_pairs() -> ~[~[u8]] {
+        unsafe fn get_env_pairs() -> Vec<~[u8]> {
             use c_str::CString;
 
             extern {
@@ -214,7 +212,7 @@ pub fn env_as_bytes() -> ~[(~[u8],~[u8])] {
                 fail!("os::env() failure getting env string from OS: {}",
                        os::last_os_error());
             }
-            let mut result = ~[];
+            let mut result = Vec::new();
             ptr::array_each(environ, |e| {
                 let env_pair = CString::new(e, false).as_bytes_no_nul().to_owned();
                 result.push(env_pair);
@@ -222,8 +220,8 @@ pub fn env_as_bytes() -> ~[(~[u8],~[u8])] {
             result
         }
 
-        fn env_convert(input: ~[~[u8]]) -> ~[(~[u8], ~[u8])] {
-            let mut pairs = ~[];
+        fn env_convert(input: Vec<~[u8]>) -> Vec<(~[u8], ~[u8])> {
+            let mut pairs = Vec::new();
             for p in input.iter() {
                 let vs: ~[&[u8]] = p.splitn(1, |b| *b == '=' as u8).collect();
                 let key = vs[0].to_owned();
@@ -234,7 +232,7 @@ pub fn env_as_bytes() -> ~[(~[u8],~[u8])] {
         }
         with_env_lock(|| {
             let unparsed_environ = get_env_pairs();
-            env_convert(unparsed_environ)
+            env_convert(unparsed_environ).move_iter().collect()
         })
     }
 }
@@ -457,15 +455,14 @@ pub fn self_exe_name() -> Option<Path> {
     fn load_self() -> Option<~[u8]> {
         unsafe {
             use libc::funcs::extra::_NSGetExecutablePath;
-            use slice;
             let mut sz: u32 = 0;
             _NSGetExecutablePath(ptr::mut_null(), &mut sz);
             if sz == 0 { return None; }
-            let mut v: ~[u8] = slice::with_capacity(sz as uint);
+            let mut v: Vec<u8> = Vec::with_capacity(sz as uint);
             let err = _NSGetExecutablePath(v.as_mut_ptr() as *mut i8, &mut sz);
             if err != 0 { return None; }
             v.set_len(sz as uint - 1); // chop off trailing NUL
-            Some(v)
+            Some(v.move_iter().collect())
         }
     }
 
@@ -795,11 +792,9 @@ pub fn get_exit_status() -> int {
 unsafe fn load_argc_and_argv(argc: int, argv: **c_char) -> ~[~[u8]] {
     use c_str::CString;
 
-    let mut args = ~[];
-    for i in range(0u, argc as uint) {
-        args.push(CString::new(*argv.offset(i as int), false).as_bytes_no_nul().to_owned())
-    }
-    args
+    Vec::from_fn(argc as uint, |i| {
+        CString::new(*argv.offset(i as int), false).as_bytes_no_nul().to_owned()
+    }).move_iter().collect()
 }
 
 /**
@@ -842,27 +837,24 @@ fn real_args() -> ~[~str] {
     let lpCmdLine = unsafe { GetCommandLineW() };
     let szArgList = unsafe { CommandLineToArgvW(lpCmdLine, lpArgCount) };
 
-    let mut args = ~[];
-    for i in range(0u, nArgs as uint) {
-        unsafe {
-            // Determine the length of this argument.
-            let ptr = *szArgList.offset(i as int);
-            let mut len = 0;
-            while *ptr.offset(len as int) != 0 { len += 1; }
-
-            // Push it onto the list.
-            let opt_s = slice::raw::buf_as_slice(ptr, len, |buf| {
-                    str::from_utf16(str::truncate_utf16_at_nul(buf))
-                });
-            args.push(opt_s.expect("CommandLineToArgvW returned invalid UTF-16"));
-        }
-    }
+    let args = Vec::from_fn(nArgs as uint, |i| unsafe {
+        // Determine the length of this argument.
+        let ptr = *szArgList.offset(i as int);
+        let mut len = 0;
+        while *ptr.offset(len as int) != 0 { len += 1; }
+
+        // Push it onto the list.
+        let opt_s = slice::raw::buf_as_slice(ptr, len, |buf| {
+            str::from_utf16(str::truncate_utf16_at_nul(buf))
+        });
+        opt_s.expect("CommandLineToArgvW returned invalid UTF-16")
+    });
 
     unsafe {
         LocalFree(szArgList as *c_void);
     }
 
-    return args;
+    return args.move_iter().collect();
 }
 
 #[cfg(windows)]
diff --git a/src/libstd/path/mod.rs b/src/libstd/path/mod.rs
index 6a1f9c1a4c7..2960d55f337 100644
--- a/src/libstd/path/mod.rs
+++ b/src/libstd/path/mod.rs
@@ -74,7 +74,7 @@ use option::{Option, None, Some};
 use str;
 use str::{MaybeOwned, Str, StrSlice, from_utf8_lossy};
 use strbuf::StrBuf;
-use slice::{OwnedCloneableVector, OwnedVector, Vector};
+use slice::Vector;
 use slice::{ImmutableEqVector, ImmutableVector};
 use vec::Vec;
 
diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs
index 1a80e52359d..47f9604d63f 100644
--- a/src/libstd/path/posix.rs
+++ b/src/libstd/path/posix.rs
@@ -21,7 +21,7 @@ use option::{Option, None, Some};
 use str;
 use str::Str;
 use slice::{CloneableVector, RevSplits, Splits, Vector, VectorVector,
-            ImmutableEqVector, OwnedVector, ImmutableVector, OwnedCloneableVector};
+            ImmutableEqVector, OwnedVector, ImmutableVector};
 use vec::Vec;
 
 use super::{BytesContainer, GenericPath, GenericPathUnsafe};
diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs
index 435b64e8d2a..58c7aaa2d32 100644
--- a/src/libstd/path/windows.rs
+++ b/src/libstd/path/windows.rs
@@ -21,7 +21,7 @@ use io::Writer;
 use iter::{AdditiveIterator, DoubleEndedIterator, Extendable, Rev, Iterator, Map};
 use option::{Option, Some, None};
 use slice::{Vector, OwnedVector, ImmutableVector};
-use str::{CharSplits, OwnedStr, Str, StrVector, StrSlice};
+use str::{CharSplits, Str, StrVector, StrSlice};
 use strbuf::StrBuf;
 use vec::Vec;
 
diff --git a/src/libstd/prelude.rs b/src/libstd/prelude.rs
index b7bcbefa468..a44b23c4249 100644
--- a/src/libstd/prelude.rs
+++ b/src/libstd/prelude.rs
@@ -56,7 +56,7 @@ pub use tuple::{Tuple1, Tuple2, Tuple3, Tuple4};
 pub use tuple::{Tuple5, Tuple6, Tuple7, Tuple8};
 pub use tuple::{Tuple9, Tuple10, Tuple11, Tuple12};
 pub use slice::{ImmutableEqVector, ImmutableTotalOrdVector, ImmutableCloneableVector};
-pub use slice::{OwnedVector, OwnedCloneableVector, OwnedEqVector};
+pub use slice::{OwnedVector};
 pub use slice::{MutableVector, MutableTotalOrdVector};
 pub use slice::{Vector, VectorVector, CloneableVector, ImmutableVector};
 pub use strbuf::StrBuf;
diff --git a/src/libstd/ptr.rs b/src/libstd/ptr.rs
index 19eee8755a0..61461096ed9 100644
--- a/src/libstd/ptr.rs
+++ b/src/libstd/ptr.rs
@@ -170,10 +170,9 @@ pub fn mut_null<T>() -> *mut T { 0 as *mut T }
 ///
 /// ```
 /// use std::ptr;
-/// use std::slice;
 ///
-/// unsafe fn from_buf_raw<T>(ptr: *T, elts: uint) -> ~[T] {
-///     let mut dst = slice::with_capacity(elts);
+/// unsafe fn from_buf_raw<T>(ptr: *T, elts: uint) -> Vec<T> {
+///     let mut dst = Vec::with_capacity(elts);
 ///     dst.set_len(elts);
 ///     ptr::copy_memory(dst.as_mut_ptr(), ptr, elts);
 ///     dst
diff --git a/src/libstd/repr.rs b/src/libstd/repr.rs
index 7205edee611..61238f508c1 100644
--- a/src/libstd/repr.rs
+++ b/src/libstd/repr.rs
@@ -28,7 +28,7 @@ use reflect::{MovePtr, align};
 use result::{Ok, Err};
 use str::StrSlice;
 use to_str::ToStr;
-use slice::{Vector, OwnedVector};
+use slice::Vector;
 use intrinsics::{Disr, Opaque, TyDesc, TyVisitor, get_tydesc, visit_tydesc};
 use raw;
 use vec::Vec;
diff --git a/src/libstd/rt/args.rs b/src/libstd/rt/args.rs
index 328de696914..abe2e2ab1dc 100644
--- a/src/libstd/rt/args.rs
+++ b/src/libstd/rt/args.rs
@@ -125,13 +125,14 @@ mod imp {
     unsafe fn load_argc_and_argv(argc: int, argv: **u8) -> ~[~[u8]] {
         use c_str::CString;
         use ptr::RawPtr;
-        use {slice, libc};
+        use libc;
         use slice::CloneableVector;
+        use vec::Vec;
 
-        slice::from_fn(argc as uint, |i| {
+        Vec::from_fn(argc as uint, |i| {
             let cs = CString::new(*(argv as **libc::c_char).offset(i as int), false);
             cs.as_bytes_no_nul().to_owned()
-        })
+        }).move_iter().collect()
     }
 
     #[cfg(test)]
diff --git a/src/libstd/slice.rs b/src/libstd/slice.rs
index 153e21c780c..4210b2ec670 100644
--- a/src/libstd/slice.rs
+++ b/src/libstd/slice.rs
@@ -54,9 +54,9 @@ An example is the method `.push(element)` that will add an element at the end
 of the vector:
 
 ```rust
-let mut numbers = ~[0, 1, 2];
+let mut numbers = vec![0, 1, 2];
 numbers.push(7);
-// numbers is now ~[0, 1, 2, 7];
+// numbers is now vec![0, 1, 2, 7];
  ```
 
 ## Implementations of other traits
@@ -99,117 +99,31 @@ There are a number of free functions that create or take vectors, for example:
 
 */
 
-#![warn(non_camel_case_types)]
-
 use cast;
 use cast::transmute;
 use ops::Drop;
 use clone::Clone;
-use container::{Container, Mutable};
+use container::Container;
 use cmp::{Eq, TotalOrd, Ordering, Less, Equal, Greater};
 use cmp;
 use default::Default;
 use fmt;
 use iter::*;
-use num::{CheckedAdd, Saturating, checked_next_power_of_two, div_rem};
+use num::{CheckedAdd, Saturating, div_rem};
+use num::CheckedMul;
 use option::{None, Option, Some};
 use ptr;
 use ptr::RawPtr;
-use rt::global_heap::{malloc_raw, realloc_raw, exchange_free};
+use rt::global_heap::{malloc_raw, exchange_free};
 use result::{Ok, Err};
 use mem;
 use mem::size_of;
 use kinds::marker;
 use uint;
 use unstable::finally::try_finally;
-use raw::{Repr, Slice, Vec};
-
-/**
- * Creates and initializes an owned vector.
- *
- * Creates an owned vector of size `n_elts` and initializes the elements
- * to the value returned by the function `op`.
- */
-pub fn from_fn<T>(n_elts: uint, op: |uint| -> T) -> ~[T] {
-    unsafe {
-        let mut v = with_capacity(n_elts);
-        let p = v.as_mut_ptr();
-        let mut i = 0;
-        try_finally(
-            &mut i, (),
-            |i, ()| while *i < n_elts {
-                mem::move_val_init(
-                    &mut(*p.offset(*i as int)),
-                    op(*i));
-                *i += 1u;
-            },
-            |i| v.set_len(*i));
-        v
-    }
-}
-
-/**
- * Creates and initializes an owned vector.
- *
- * Creates an owned vector of size `n_elts` and initializes the elements
- * to the value `t`.
- */
-pub fn from_elem<T:Clone>(n_elts: uint, t: T) -> ~[T] {
-    // FIXME (#7136): manually inline from_fn for 2x plus speedup (sadly very
-    // important, from_elem is a bottleneck in borrowck!). Unfortunately it
-    // still is substantially slower than using the unsafe
-    // slice::with_capacity/ptr::set_memory for primitive types.
-    unsafe {
-        let mut v = with_capacity(n_elts);
-        let p = v.as_mut_ptr();
-        let mut i = 0u;
-        try_finally(
-            &mut i, (),
-            |i, ()| while *i < n_elts {
-                mem::move_val_init(
-                    &mut(*p.offset(*i as int)),
-                    t.clone());
-                *i += 1u;
-            },
-            |i| v.set_len(*i));
-        v
-    }
-}
-
-/// Creates a new vector with a capacity of `capacity`
-#[inline]
-pub fn with_capacity<T>(capacity: uint) -> ~[T] {
-    unsafe {
-        let alloc = capacity * mem::nonzero_size_of::<T>();
-        let size = alloc + mem::size_of::<Vec<()>>();
-        if alloc / mem::nonzero_size_of::<T>() != capacity || size < alloc {
-            fail!("vector size is too large: {}", capacity);
-        }
-        let ptr = malloc_raw(size) as *mut Vec<()>;
-        (*ptr).alloc = alloc;
-        (*ptr).fill = 0;
-        transmute(ptr)
-    }
-}
-
-/**
- * Builds a vector by calling a provided function with an argument
- * function that pushes an element to the back of a vector.
- * The initial capacity for the vector may optionally be specified.
- *
- * # Arguments
- *
- * * size - An option, maybe containing initial size of the vector to reserve
- * * builder - A function that will construct the vector. It receives
- *             as an argument a function that will push an element
- *             onto the vector being constructed.
- */
-#[inline]
-pub fn build<A>(size: Option<uint>, builder: |push: |v: A||) -> ~[A] {
-    let mut vec = with_capacity(size.unwrap_or(4));
-    builder(|x| vec.push(x));
-    vec
-}
+use raw::{Repr, Slice};
+use RawVec = raw::Vec;
+use vec::Vec;
 
 /**
  * Converts a pointer to A into a slice of length 1 (without copying).
@@ -326,26 +240,6 @@ impl<'a, T> Iterator<&'a [T]> for RevSplits<'a, T> {
     }
 }
 
-// Appending
-
-/// Iterates over the `rhs` vector, copying each element and appending it to the
-/// `lhs`. Afterwards, the `lhs` is then returned for use again.
-#[inline]
-pub fn append<T:Clone>(lhs: ~[T], rhs: &[T]) -> ~[T] {
-    let mut v = lhs;
-    v.push_all(rhs);
-    v
-}
-
-/// Appends one element to the vector provided. The vector itself is then
-/// returned for use again.
-#[inline]
-pub fn append_one<T>(lhs: ~[T], x: T) -> ~[T] {
-    let mut v = lhs;
-    v.push(x);
-    v
-}
-
 // Functional utilities
 
 #[allow(missing_doc)]
@@ -362,22 +256,22 @@ pub trait VectorVector<T> {
 impl<'a, T: Clone, V: Vector<T>> VectorVector<T> for &'a [V] {
     fn concat_vec(&self) -> ~[T] {
         let size = self.iter().fold(0u, |acc, v| acc + v.as_slice().len());
-        let mut result = with_capacity(size);
+        let mut result = Vec::with_capacity(size);
         for v in self.iter() {
             result.push_all(v.as_slice())
         }
-        result
+        result.move_iter().collect()
     }
 
     fn connect_vec(&self, sep: &T) -> ~[T] {
         let size = self.iter().fold(0u, |acc, v| acc + v.as_slice().len());
-        let mut result = with_capacity(size + self.len());
+        let mut result = Vec::with_capacity(size + self.len());
         let mut first = true;
         for v in self.iter() {
             if first { first = false } else { result.push(sep.clone()) }
             result.push_all(v.as_slice())
         }
-        result
+        result.move_iter().collect()
     }
 }
 
@@ -391,13 +285,13 @@ impl<'a, T: Clone, V: Vector<T>> VectorVector<T> for &'a [V] {
  */
 pub fn unzip<T, U, V: Iterator<(T, U)>>(mut iter: V) -> (~[T], ~[U]) {
     let (lo, _) = iter.size_hint();
-    let mut ts = with_capacity(lo);
-    let mut us = with_capacity(lo);
+    let mut ts = Vec::with_capacity(lo);
+    let mut us = Vec::with_capacity(lo);
     for (t, u) in iter {
         ts.push(t);
         us.push(u);
     }
-    (ts, us)
+    (ts.move_iter().collect(), us.move_iter().collect())
 }
 
 /// An Iterator that yields the element swaps needed to produce
@@ -618,8 +512,9 @@ pub mod traits {
     use container::Container;
     use clone::Clone;
     use cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Equiv};
-    use iter::order;
+    use iter::{order, Iterator};
     use ops::Add;
+    use vec::Vec;
 
     impl<'a,T:Eq> Eq for &'a [T] {
         fn eq(&self, other: & &'a [T]) -> bool {
@@ -696,10 +591,10 @@ pub mod traits {
     impl<'a,T:Clone, V: Vector<T>> Add<V, ~[T]> for &'a [T] {
         #[inline]
         fn add(&self, rhs: &V) -> ~[T] {
-            let mut res = with_capacity(self.len() + rhs.as_slice().len());
+            let mut res = Vec::with_capacity(self.len() + rhs.as_slice().len());
             res.push_all(*self);
             res.push_all(rhs.as_slice());
-            res
+            res.move_iter().collect()
         }
     }
 
@@ -761,7 +656,7 @@ impl<'a, T: Clone> CloneableVector<T> for &'a [T] {
     #[inline]
     fn to_owned(&self) -> ~[T] {
         let len = self.len();
-        let mut result = with_capacity(len);
+        let mut result = Vec::with_capacity(len);
         // Unsafe code so this can be optimised to a memcpy (or something
         // similarly fast) when T is Copy. LLVM is easily confused, so any
         // extra operations during the loop can prevent this optimisation
@@ -780,7 +675,7 @@ impl<'a, T: Clone> CloneableVector<T> for &'a [T] {
                 },
                 |i| result.set_len(*i));
         }
-        result
+        result.move_iter().collect()
     }
 
     #[inline(always)]
@@ -1215,8 +1110,8 @@ pub trait ImmutableCloneableVector<T> {
 impl<'a,T:Clone> ImmutableCloneableVector<T> for &'a [T] {
     #[inline]
     fn partitioned(&self, f: |&T| -> bool) -> (~[T], ~[T]) {
-        let mut lefts  = ~[];
-        let mut rights = ~[];
+        let mut lefts  = Vec::new();
+        let mut rights = Vec::new();
 
         for elt in self.iter() {
             if f(elt) {
@@ -1226,7 +1121,7 @@ impl<'a,T:Clone> ImmutableCloneableVector<T> for &'a [T] {
             }
         }
 
-        (lefts, rights)
+        (lefts.move_iter().collect(), rights.move_iter().collect())
     }
 
     fn permutations(self) -> Permutations<T> {
@@ -1259,148 +1154,10 @@ pub trait OwnedVector<T> {
     fn move_rev_iter(self) -> RevMoveItems<T>;
 
     /**
-     * Reserves capacity for exactly `n` elements in the given vector.
-     *
-     * If the capacity for `self` is already equal to or greater than the requested
-     * capacity, then no action is taken.
-     *
-     * # Arguments
-     *
-     * * n - The number of elements to reserve space for
-     *
-     * # Failure
-     *
-     * This method always succeeds in reserving space for `n` elements, or it does
-     * not return.
-     */
-    fn reserve_exact(&mut self, n: uint);
-    /**
-     * Reserves capacity for at least `n` elements in the given vector.
-     *
-     * This function will over-allocate in order to amortize the allocation costs
-     * in scenarios where the caller may need to repeatedly reserve additional
-     * space.
-     *
-     * If the capacity for `self` is already equal to or greater than the requested
-     * capacity, then no action is taken.
-     *
-     * # Arguments
-     *
-     * * n - The number of elements to reserve space for
-     */
-    fn reserve(&mut self, n: uint);
-    /**
-     * Reserves capacity for at least `n` additional elements in the given vector.
-     *
-     * # Failure
-     *
-     * Fails if the new required capacity overflows uint.
-     *
-     * May also fail if `reserve` fails.
-     */
-    fn reserve_additional(&mut self, n: uint);
-    /// Returns the number of elements the vector can hold without reallocating.
-    fn capacity(&self) -> uint;
-    /// Shrink the capacity of the vector to match the length
-    fn shrink_to_fit(&mut self);
-
-    /// Append an element to a vector
-    fn push(&mut self, t: T);
-    /// Takes ownership of the vector `rhs`, moving all elements into
-    /// the current vector. This does not copy any elements, and it is
-    /// illegal to use the `rhs` vector after calling this method
-    /// (because it is moved here).
-    ///
-    /// # Example
-    ///
-    /// ```rust
-    /// let mut a = ~[~1];
-    /// a.push_all_move(~[~2, ~3, ~4]);
-    /// assert!(a == ~[~1, ~2, ~3, ~4]);
-    /// ```
-    fn push_all_move(&mut self, rhs: ~[T]);
-    /// Remove the last element from a vector and return it, or `None` if it is empty
-    fn pop(&mut self) -> Option<T>;
-    /// Removes the first element from a vector and return it, or `None` if it is empty
-    fn shift(&mut self) -> Option<T>;
-    /// Prepend an element to the vector
-    fn unshift(&mut self, x: T);
-
-    /// Insert an element at position i within v, shifting all
-    /// elements after position i one position to the right.
-    fn insert(&mut self, i: uint, x:T);
-
-    /// Remove and return the element at position `i` within `v`,
-    /// shifting all elements after position `i` one position to the
-    /// left. Returns `None` if `i` is out of bounds.
-    ///
-    /// # Example
-    /// ```rust
-    /// let mut v = ~[1, 2, 3];
-    /// assert_eq!(v.remove(1), Some(2));
-    /// assert_eq!(v, ~[1, 3]);
-    ///
-    /// assert_eq!(v.remove(4), None);
-    /// // v is unchanged:
-    /// assert_eq!(v, ~[1, 3]);
-    /// ```
-    fn remove(&mut self, i: uint) -> Option<T>;
-
-    /// Remove an element from anywhere in the vector and return it, replacing it
-    /// with the last element. This does not preserve ordering, but is O(1).
-    ///
-    /// Returns `None` if `index` is out of bounds.
-    ///
-    /// # Example
-    /// ```rust
-    /// let mut v = ~[~"foo", ~"bar", ~"baz", ~"qux"];
-    ///
-    /// assert_eq!(v.swap_remove(1), Some(~"bar"));
-    /// assert_eq!(v, ~[~"foo", ~"qux", ~"baz"]);
-    ///
-    /// assert_eq!(v.swap_remove(0), Some(~"foo"));
-    /// assert_eq!(v, ~[~"baz", ~"qux"]);
-    ///
-    /// assert_eq!(v.swap_remove(2), None);
-    /// ```
-    fn swap_remove(&mut self, index: uint) -> Option<T>;
-
-    /// Shorten a vector, dropping excess elements.
-    fn truncate(&mut self, newlen: uint);
-
-    /**
-     * Like `filter()`, but in place.  Preserves order of `v`.  Linear time.
-     */
-    fn retain(&mut self, f: |t: &T| -> bool);
-
-    /**
      * Partitions the vector into two vectors `(A,B)`, where all
      * elements of `A` satisfy `f` and all elements of `B` do not.
      */
     fn partition(self, f: |&T| -> bool) -> (~[T], ~[T]);
-
-    /**
-     * Expands a vector in place, initializing the new elements to the result of
-     * a function.
-     *
-     * Function `init_op` is called `n` times with the values [0..`n`)
-     *
-     * # Arguments
-     *
-     * * n - The number of elements to add
-     * * init_op - A function to call to retrieve each appended element's
-     *             value
-     */
-    fn grow_fn(&mut self, n: uint, op: |uint| -> T);
-
-    /**
-     * Sets the length of a vector
-     *
-     * This will explicitly set the size of the vector, without actually
-     * modifying its buffers, so it is up to the caller to ensure that
-     * the vector is actually the specified size.
-     */
-    unsafe fn set_len(&mut self, new_len: uint);
 }
 
 impl<T> OwnedVector<T> for ~[T] {
@@ -1418,202 +1175,10 @@ impl<T> OwnedVector<T> for ~[T] {
         self.move_iter().rev()
     }
 
-    fn reserve_exact(&mut self, n: uint) {
-        // Only make the (slow) call into the runtime if we have to
-        if self.capacity() < n {
-            unsafe {
-                let ptr: *mut *mut Vec<()> = transmute(self);
-                let alloc = n * mem::nonzero_size_of::<T>();
-                let size = alloc + mem::size_of::<Vec<()>>();
-                if alloc / mem::nonzero_size_of::<T>() != n || size < alloc {
-                    fail!("vector size is too large: {}", n);
-                }
-                *ptr = realloc_raw(*ptr as *mut u8, size)
-                                   as *mut Vec<()>;
-                (**ptr).alloc = alloc;
-            }
-        }
-    }
-
-    #[inline]
-    fn reserve(&mut self, n: uint) {
-        self.reserve_exact(checked_next_power_of_two(n).unwrap_or(n));
-    }
-
-    #[inline]
-    fn reserve_additional(&mut self, n: uint) {
-        if self.capacity() - self.len() < n {
-            match self.len().checked_add(&n) {
-                None => fail!("slice::reserve_additional: `uint` overflow"),
-                Some(new_cap) => self.reserve(new_cap)
-            }
-        }
-    }
-
-    #[inline]
-    fn capacity(&self) -> uint {
-        unsafe {
-            let repr: **Vec<()> = transmute(self);
-            (**repr).alloc / mem::nonzero_size_of::<T>()
-        }
-    }
-
-    fn shrink_to_fit(&mut self) {
-        unsafe {
-            let ptr: *mut *mut Vec<()> = transmute(self);
-            let alloc = (**ptr).fill;
-            let size = alloc + mem::size_of::<Vec<()>>();
-            *ptr = realloc_raw(*ptr as *mut u8, size) as *mut Vec<()>;
-            (**ptr).alloc = alloc;
-        }
-    }
-
-    #[inline]
-    fn push(&mut self, t: T) {
-        unsafe {
-            let repr: **Vec<()> = transmute(&mut *self);
-            let fill = (**repr).fill;
-            if (**repr).alloc <= fill {
-                self.reserve_additional(1);
-            }
-
-            push_fast(self, t);
-        }
-
-        // This doesn't bother to make sure we have space.
-        #[inline] // really pretty please
-        unsafe fn push_fast<T>(this: &mut ~[T], t: T) {
-            let repr: **mut Vec<u8> = transmute(this);
-            let fill = (**repr).fill;
-            (**repr).fill += mem::nonzero_size_of::<T>();
-            let p = &((**repr).data) as *u8;
-            let p = p.offset(fill as int) as *mut T;
-            mem::move_val_init(&mut(*p), t);
-        }
-    }
-
-    #[inline]
-    fn push_all_move(&mut self, mut rhs: ~[T]) {
-        let self_len = self.len();
-        let rhs_len = rhs.len();
-        let new_len = self_len + rhs_len;
-        self.reserve_additional(rhs.len());
-        unsafe { // Note: infallible.
-            let self_p = self.as_mut_ptr();
-            let rhs_p = rhs.as_ptr();
-            ptr::copy_memory(self_p.offset(self_len as int), rhs_p, rhs_len);
-            self.set_len(new_len);
-            rhs.set_len(0);
-        }
-    }
-
-    fn pop(&mut self) -> Option<T> {
-        match self.len() {
-            0  => None,
-            ln => {
-                let valptr = &mut self[ln - 1u] as *mut T;
-                unsafe {
-                    self.set_len(ln - 1u);
-                    Some(ptr::read(&*valptr))
-                }
-            }
-        }
-    }
-
-
-    #[inline]
-    fn shift(&mut self) -> Option<T> {
-        self.remove(0)
-    }
-
-    #[inline]
-    fn unshift(&mut self, x: T) {
-        self.insert(0, x)
-    }
-
-    fn insert(&mut self, i: uint, x: T) {
-        let len = self.len();
-        assert!(i <= len);
-        // space for the new element
-        self.reserve_additional(1);
-
-        unsafe { // infallible
-            // The spot to put the new value
-            let p = self.as_mut_ptr().offset(i as int);
-            // Shift everything over to make space. (Duplicating the
-            // `i`th element into two consecutive places.)
-            ptr::copy_memory(p.offset(1), &*p, len - i);
-            // Write it in, overwriting the first copy of the `i`th
-            // element.
-            mem::move_val_init(&mut *p, x);
-            self.set_len(len + 1);
-        }
-    }
-
-    fn remove(&mut self, i: uint) -> Option<T> {
-        let len = self.len();
-        if i < len {
-            unsafe { // infallible
-                // the place we are taking from.
-                let ptr = self.as_mut_ptr().offset(i as int);
-                // copy it out, unsafely having a copy of the value on
-                // the stack and in the vector at the same time.
-                let ret = Some(ptr::read(ptr as *T));
-
-                // Shift everything down to fill in that spot.
-                ptr::copy_memory(ptr, &*ptr.offset(1), len - i - 1);
-                self.set_len(len - 1);
-
-                ret
-            }
-        } else {
-            None
-        }
-    }
-    fn swap_remove(&mut self, index: uint) -> Option<T> {
-        let ln = self.len();
-        if index < ln - 1 {
-            self.swap(index, ln - 1);
-        } else if index >= ln {
-            return None
-        }
-        self.pop()
-    }
-    fn truncate(&mut self, newlen: uint) {
-        let oldlen = self.len();
-        assert!(newlen <= oldlen);
-
-        unsafe {
-            let p = self.as_mut_ptr();
-            // This loop is optimized out for non-drop types.
-            for i in range(newlen, oldlen) {
-                ptr::read_and_zero(p.offset(i as int));
-            }
-        }
-        unsafe { self.set_len(newlen); }
-    }
-
-    fn retain(&mut self, f: |t: &T| -> bool) {
-        let len = self.len();
-        let mut deleted: uint = 0;
-
-        for i in range(0u, len) {
-            if !f(&self[i]) {
-                deleted += 1;
-            } else if deleted > 0 {
-                self.swap(i - deleted, i);
-            }
-        }
-
-        if deleted > 0 {
-            self.truncate(len - deleted);
-        }
-    }
-
     #[inline]
     fn partition(self, f: |&T| -> bool) -> (~[T], ~[T]) {
-        let mut lefts  = ~[];
-        let mut rights = ~[];
+        let mut lefts  = Vec::new();
+        let mut rights = Vec::new();
 
         for elt in self.move_iter() {
             if f(&elt) {
@@ -1623,184 +1188,7 @@ impl<T> OwnedVector<T> for ~[T] {
             }
         }
 
-        (lefts, rights)
-    }
-    fn grow_fn(&mut self, n: uint, op: |uint| -> T) {
-        let new_len = self.len() + n;
-        self.reserve(new_len);
-        let mut i: uint = 0u;
-        while i < n {
-            self.push(op(i));
-            i += 1u;
-        }
-    }
-
-    #[inline]
-    unsafe fn set_len(&mut self, new_len: uint) {
-        let repr: **mut Vec<()> = transmute(self);
-        (**repr).fill = new_len * mem::nonzero_size_of::<T>();
-    }
-}
-
-impl<T> Mutable for ~[T] {
-    /// Clear the vector, removing all values.
-    fn clear(&mut self) { self.truncate(0) }
-}
-
-/// Extension methods for owned vectors containing `Clone` elements.
-pub trait OwnedCloneableVector<T:Clone> {
-    /// Iterates over the slice `rhs`, copies each element, and then appends it to
-    /// the vector provided `v`. The `rhs` vector is traversed in-order.
-    ///
-    /// # Example
-    ///
-    /// ```rust
-    /// let mut a = ~[1];
-    /// a.push_all([2, 3, 4]);
-    /// assert!(a == ~[1, 2, 3, 4]);
-    /// ```
-    fn push_all(&mut self, rhs: &[T]);
-
-    /**
-     * Expands a vector in place, initializing the new elements to a given value
-     *
-     * # Arguments
-     *
-     * * n - The number of elements to add
-     * * initval - The value for the new elements
-     */
-    fn grow(&mut self, n: uint, initval: &T);
-
-    /**
-     * Sets the value of a vector element at a given index, growing the vector as
-     * needed
-     *
-     * Sets the element at position `index` to `val`. If `index` is past the end
-     * of the vector, expands the vector by replicating `initval` to fill the
-     * intervening space.
-     */
-    fn grow_set(&mut self, index: uint, initval: &T, val: T);
-}
-
-impl<T:Clone> OwnedCloneableVector<T> for ~[T] {
-    #[inline]
-    fn push_all(&mut self, rhs: &[T]) {
-        let new_len = self.len() + rhs.len();
-        self.reserve_exact(new_len);
-
-        for elt in rhs.iter() {
-            self.push((*elt).clone())
-        }
-    }
-    fn grow(&mut self, n: uint, initval: &T) {
-        let new_len = self.len() + n;
-        self.reserve(new_len);
-        let mut i: uint = 0u;
-
-        while i < n {
-            self.push((*initval).clone());
-            i += 1u;
-        }
-    }
-    fn grow_set(&mut self, index: uint, initval: &T, val: T) {
-        let l = self.len();
-        if index >= l { self.grow(index - l + 1u, initval); }
-        self[index] = val;
-    }
-}
-
-/// Extension methods for owned vectors containing `Eq` elements.
-pub trait OwnedEqVector<T:Eq> {
-    /**
-    * Remove consecutive repeated elements from a vector; if the vector is
-    * sorted, this removes all duplicates.
-    */
-    fn dedup(&mut self);
-}
-
-impl<T:Eq> OwnedEqVector<T> for ~[T] {
-    fn dedup(&mut self) {
-        unsafe {
-            // Although we have a mutable reference to `self`, we cannot make
-            // *arbitrary* changes. The `Eq` comparisons could fail, so we
-            // must ensure that the vector is in a valid state at all time.
-            //
-            // The way that we handle this is by using swaps; we iterate
-            // over all the elements, swapping as we go so that at the end
-            // the elements we wish to keep are in the front, and those we
-            // wish to reject are at the back. We can then truncate the
-            // vector. This operation is still O(n).
-            //
-            // Example: We start in this state, where `r` represents "next
-            // read" and `w` represents "next_write`.
-            //
-            //           r
-            //     +---+---+---+---+---+---+
-            //     | 0 | 1 | 1 | 2 | 3 | 3 |
-            //     +---+---+---+---+---+---+
-            //           w
-            //
-            // Comparing self[r] against self[w-1], tis is not a duplicate, so
-            // we swap self[r] and self[w] (no effect as r==w) and then increment both
-            // r and w, leaving us with:
-            //
-            //               r
-            //     +---+---+---+---+---+---+
-            //     | 0 | 1 | 1 | 2 | 3 | 3 |
-            //     +---+---+---+---+---+---+
-            //               w
-            //
-            // Comparing self[r] against self[w-1], this value is a duplicate,
-            // so we increment `r` but leave everything else unchanged:
-            //
-            //                   r
-            //     +---+---+---+---+---+---+
-            //     | 0 | 1 | 1 | 2 | 3 | 3 |
-            //     +---+---+---+---+---+---+
-            //               w
-            //
-            // Comparing self[r] against self[w-1], this is not a duplicate,
-            // so swap self[r] and self[w] and advance r and w:
-            //
-            //                       r
-            //     +---+---+---+---+---+---+
-            //     | 0 | 1 | 2 | 1 | 3 | 3 |
-            //     +---+---+---+---+---+---+
-            //                   w
-            //
-            // Not a duplicate, repeat:
-            //
-            //                           r
-            //     +---+---+---+---+---+---+
-            //     | 0 | 1 | 2 | 3 | 1 | 3 |
-            //     +---+---+---+---+---+---+
-            //                       w
-            //
-            // Duplicate, advance r. End of vec. Truncate to w.
-
-            let ln = self.len();
-            if ln < 1 { return; }
-
-            // Avoid bounds checks by using unsafe pointers.
-            let p = self.as_mut_ptr();
-            let mut r = 1;
-            let mut w = 1;
-
-            while r < ln {
-                let p_r = p.offset(r as int);
-                let p_wm1 = p.offset((w - 1) as int);
-                if *p_r != *p_wm1 {
-                    if r != w {
-                        let p_w = p_wm1.offset(1);
-                        mem::swap(&mut *p_r, &mut *p_w);
-                    }
-                    w += 1;
-                }
-                r += 1;
-            }
-
-            self.truncate(w);
-        }
+        (lefts.move_iter().collect(), rights.move_iter().collect())
     }
 }
 
@@ -1872,7 +1260,7 @@ fn merge_sort<T>(v: &mut [T], compare: |&T, &T| -> Ordering) {
     // length 0 so we can keep shallow copies of the contents of `v`
     // without risking the dtors running on an object twice if
     // `compare` fails.
-    let mut working_space = with_capacity(2 * len);
+    let mut working_space = Vec::with_capacity(2 * len);
     // these both are buffers of length `len`.
     let mut buf_dat = working_space.as_mut_ptr();
     let mut buf_tmp = unsafe {buf_dat.offset(len as int)};
@@ -2475,10 +1863,12 @@ pub unsafe fn from_buf<T>(ptr: *T, elts: uint) -> ~[T] {
 /// Unsafe operations
 pub mod raw {
     use cast::transmute;
-    use ptr;
+    use iter::Iterator;
     use ptr::RawPtr;
-    use slice::{with_capacity, MutableVector, OwnedVector};
+    use ptr;
     use raw::Slice;
+    use slice::{MutableVector, OwnedVector};
+    use vec::Vec;
 
     /**
      * Form a slice from a pointer and length (as a number of units,
@@ -2521,10 +1911,10 @@ pub mod raw {
     // Was in raw, but needs to be called by net_tcp::on_tcp_read_cb
     #[inline]
     pub unsafe fn from_buf_raw<T>(ptr: *T, elts: uint) -> ~[T] {
-        let mut dst = with_capacity(elts);
+        let mut dst = Vec::with_capacity(elts);
         dst.set_len(elts);
         ptr::copy_memory(dst.as_mut_ptr(), ptr, elts);
-        dst
+        dst.move_iter().collect()
     }
 
     /**
@@ -2556,9 +1946,8 @@ pub mod raw {
 /// Operations on `[u8]`.
 pub mod bytes {
     use container::Container;
-    use slice::{MutableVector, OwnedVector, ImmutableVector};
+    use slice::MutableVector;
     use ptr;
-    use ptr::RawPtr;
 
     /// A trait for operations on mutable `[u8]`s.
     pub trait MutableByteVector {
@@ -2582,19 +1971,6 @@ pub mod bytes {
         // Bound checks are done at .copy_memory.
         unsafe { dst.copy_memory(src) }
     }
-
-    /**
-     * Allocate space in `dst` and append the data to `src`.
-     */
-    #[inline]
-    pub fn push_bytes(dst: &mut ~[u8], src: &[u8]) {
-        let old_len = dst.len();
-        dst.reserve_additional(src.len());
-        unsafe {
-            ptr::copy_memory(dst.as_mut_ptr().offset(old_len as int), src.as_ptr(), src.len());
-            dst.set_len(old_len + src.len());
-        }
-    }
 }
 
 impl<A: Clone> Clone for ~[A] {
@@ -2603,17 +1979,6 @@ impl<A: Clone> Clone for ~[A] {
         // Use the fast to_owned on &[A] for cloning
         self.as_slice().to_owned()
     }
-
-    fn clone_from(&mut self, source: &~[A]) {
-        if self.len() < source.len() {
-            *self = source.clone()
-        } else {
-            self.truncate(source.len());
-            for (x, y) in self.mut_iter().zip(source.iter()) {
-                x.clone_from(y);
-            }
-        }
-    }
 }
 
 impl<'a, T: fmt::Show> fmt::Show for &'a [T] {
@@ -2914,22 +2279,35 @@ pub type RevMoveItems<T> = Rev<MoveItems<T>>;
 
 impl<A> FromIterator<A> for ~[A] {
     fn from_iter<T: Iterator<A>>(mut iterator: T) -> ~[A] {
-        let (lower, _) = iterator.size_hint();
-        let mut xs = with_capacity(lower);
-        for x in iterator {
-            xs.push(x);
-        }
-        xs
-    }
-}
+        let mut xs: Vec<A> = iterator.collect();
 
-impl<A> Extendable<A> for ~[A] {
-    fn extend<T: Iterator<A>>(&mut self, mut iterator: T) {
-        let (lower, _) = iterator.size_hint();
-        let len = self.len();
-        self.reserve_exact(len + lower);
-        for x in iterator {
-            self.push(x);
+        // Must shrink so the capacity is the same as the length. The length of
+        // the ~[T] vector must exactly match the length of the allocation.
+        xs.shrink_to_fit();
+
+        let len = xs.len();
+        assert!(len == xs.capacity());
+        let data = xs.as_mut_ptr();
+
+        let data_size = len.checked_mul(&mem::size_of::<A>());
+        let data_size = data_size.expect("overflow in from_iter()");
+        let size = mem::size_of::<RawVec<()>>().checked_add(&data_size);
+        let size = size.expect("overflow in from_iter()");
+
+
+        // This is some terribly awful code. Note that all of this will go away
+        // with DST because creating ~[T] from Vec<T> will just be some pointer
+        // swizzling.
+        unsafe {
+            let ret = malloc_raw(size) as *mut RawVec<()>;
+
+            (*ret).fill = len * mem::nonzero_size_of::<A>();
+            (*ret).alloc = len * mem::nonzero_size_of::<A>();
+            ptr::copy_nonoverlapping_memory(&mut (*ret).data as *mut _ as *mut u8,
+                                            data as *u8,
+                                            data_size);
+            xs.set_len(0); // ownership has been transferred
+            cast::transmute(ret)
         }
     }
 }
@@ -2974,38 +2352,50 @@ mod tests {
     #[test]
     fn test_from_fn() {
         // Test on-stack from_fn.
-        let mut v = from_fn(3u, square);
-        assert_eq!(v.len(), 3u);
-        assert_eq!(v[0], 0u);
-        assert_eq!(v[1], 1u);
-        assert_eq!(v[2], 4u);
+        let mut v = Vec::from_fn(3u, square);
+        {
+            let v = v.as_slice();
+            assert_eq!(v.len(), 3u);
+            assert_eq!(v[0], 0u);
+            assert_eq!(v[1], 1u);
+            assert_eq!(v[2], 4u);
+        }
 
         // Test on-heap from_fn.
-        v = from_fn(5u, square);
-        assert_eq!(v.len(), 5u);
-        assert_eq!(v[0], 0u);
-        assert_eq!(v[1], 1u);
-        assert_eq!(v[2], 4u);
-        assert_eq!(v[3], 9u);
-        assert_eq!(v[4], 16u);
+        v = Vec::from_fn(5u, square);
+        {
+            let v = v.as_slice();
+            assert_eq!(v.len(), 5u);
+            assert_eq!(v[0], 0u);
+            assert_eq!(v[1], 1u);
+            assert_eq!(v[2], 4u);
+            assert_eq!(v[3], 9u);
+            assert_eq!(v[4], 16u);
+        }
     }
 
     #[test]
     fn test_from_elem() {
         // Test on-stack from_elem.
-        let mut v = from_elem(2u, 10u);
-        assert_eq!(v.len(), 2u);
-        assert_eq!(v[0], 10u);
-        assert_eq!(v[1], 10u);
+        let mut v = Vec::from_elem(2u, 10u);
+        {
+            let v = v.as_slice();
+            assert_eq!(v.len(), 2u);
+            assert_eq!(v[0], 10u);
+            assert_eq!(v[1], 10u);
+        }
 
         // Test on-heap from_elem.
-        v = from_elem(6u, 20u);
-        assert_eq!(v[0], 20u);
-        assert_eq!(v[1], 20u);
-        assert_eq!(v[2], 20u);
-        assert_eq!(v[3], 20u);
-        assert_eq!(v[4], 20u);
-        assert_eq!(v[5], 20u);
+        v = Vec::from_elem(6u, 20u);
+        {
+            let v = v.as_slice();
+            assert_eq!(v[0], 20u);
+            assert_eq!(v[1], 20u);
+            assert_eq!(v[2], 20u);
+            assert_eq!(v[3], 20u);
+            assert_eq!(v[4], 20u);
+            assert_eq!(v[5], 20u);
+        }
     }
 
     #[test]
@@ -3164,7 +2554,7 @@ mod tests {
 
     #[test]
     fn test_pop() {
-        let mut v = ~[5];
+        let mut v = vec![5];
         let e = v.pop();
         assert_eq!(v.len(), 0);
         assert_eq!(e, Some(5));
@@ -3176,25 +2566,25 @@ mod tests {
 
     #[test]
     fn test_swap_remove() {
-        let mut v = ~[1, 2, 3, 4, 5];
+        let mut v = vec![1, 2, 3, 4, 5];
         let mut e = v.swap_remove(0);
         assert_eq!(e, Some(1));
-        assert_eq!(v, ~[5, 2, 3, 4]);
+        assert_eq!(v, vec![5, 2, 3, 4]);
         e = v.swap_remove(3);
         assert_eq!(e, Some(4));
-        assert_eq!(v, ~[5, 2, 3]);
+        assert_eq!(v, vec![5, 2, 3]);
 
         e = v.swap_remove(3);
         assert_eq!(e, None);
-        assert_eq!(v, ~[5, 2, 3]);
+        assert_eq!(v, vec![5, 2, 3]);
     }
 
     #[test]
     fn test_swap_remove_noncopyable() {
         // Tests that we don't accidentally run destructors twice.
-        let mut v = ~[::unstable::sync::Exclusive::new(()),
-                      ::unstable::sync::Exclusive::new(()),
-                      ::unstable::sync::Exclusive::new(())];
+        let mut v = vec![::unstable::sync::Exclusive::new(()),
+                         ::unstable::sync::Exclusive::new(()),
+                         ::unstable::sync::Exclusive::new(())];
         let mut _e = v.swap_remove(0);
         assert_eq!(v.len(), 2);
         _e = v.swap_remove(1);
@@ -3206,41 +2596,48 @@ mod tests {
     #[test]
     fn test_push() {
         // Test on-stack push().
-        let mut v = ~[];
+        let mut v = vec![];
         v.push(1);
         assert_eq!(v.len(), 1u);
-        assert_eq!(v[0], 1);
+        assert_eq!(v.as_slice()[0], 1);
 
         // Test on-heap push().
         v.push(2);
         assert_eq!(v.len(), 2u);
-        assert_eq!(v[0], 1);
-        assert_eq!(v[1], 2);
+        assert_eq!(v.as_slice()[0], 1);
+        assert_eq!(v.as_slice()[1], 2);
     }
 
     #[test]
     fn test_grow() {
         // Test on-stack grow().
-        let mut v = ~[];
+        let mut v = vec![];
         v.grow(2u, &1);
-        assert_eq!(v.len(), 2u);
-        assert_eq!(v[0], 1);
-        assert_eq!(v[1], 1);
+        {
+            let v = v.as_slice();
+            assert_eq!(v.len(), 2u);
+            assert_eq!(v[0], 1);
+            assert_eq!(v[1], 1);
+        }
 
         // Test on-heap grow().
         v.grow(3u, &2);
-        assert_eq!(v.len(), 5u);
-        assert_eq!(v[0], 1);
-        assert_eq!(v[1], 1);
-        assert_eq!(v[2], 2);
-        assert_eq!(v[3], 2);
-        assert_eq!(v[4], 2);
+        {
+            let v = v.as_slice();
+            assert_eq!(v.len(), 5u);
+            assert_eq!(v[0], 1);
+            assert_eq!(v[1], 1);
+            assert_eq!(v[2], 2);
+            assert_eq!(v[3], 2);
+            assert_eq!(v[4], 2);
+        }
     }
 
     #[test]
     fn test_grow_fn() {
-        let mut v = ~[];
+        let mut v = vec![];
         v.grow_fn(3u, square);
+        let v = v.as_slice();
         assert_eq!(v.len(), 3u);
         assert_eq!(v[0], 0u);
         assert_eq!(v[1], 1u);
@@ -3249,8 +2646,9 @@ mod tests {
 
     #[test]
     fn test_grow_set() {
-        let mut v = ~[1, 2, 3];
+        let mut v = vec![1, 2, 3];
         v.grow_set(4u, &4, 5);
+        let v = v.as_slice();
         assert_eq!(v.len(), 5u);
         assert_eq!(v[0], 1);
         assert_eq!(v[1], 2);
@@ -3261,8 +2659,9 @@ mod tests {
 
     #[test]
     fn test_truncate() {
-        let mut v = ~[~6,~5,~4];
+        let mut v = vec![~6,~5,~4];
         v.truncate(1);
+        let v = v.as_slice();
         assert_eq!(v.len(), 1);
         assert_eq!(*(v[0]), 6);
         // If the unsafe block didn't drop things properly, we blow up here.
@@ -3270,7 +2669,7 @@ mod tests {
 
     #[test]
     fn test_clear() {
-        let mut v = ~[~6,~5,~4];
+        let mut v = vec![~6,~5,~4];
         v.clear();
         assert_eq!(v.len(), 0);
         // If the unsafe block didn't drop things properly, we blow up here.
@@ -3278,28 +2677,28 @@ mod tests {
 
     #[test]
     fn test_dedup() {
-        fn case(a: ~[uint], b: ~[uint]) {
+        fn case(a: Vec<uint>, b: Vec<uint>) {
             let mut v = a;
             v.dedup();
             assert_eq!(v, b);
         }
-        case(~[], ~[]);
-        case(~[1], ~[1]);
-        case(~[1,1], ~[1]);
-        case(~[1,2,3], ~[1,2,3]);
-        case(~[1,1,2,3], ~[1,2,3]);
-        case(~[1,2,2,3], ~[1,2,3]);
-        case(~[1,2,3,3], ~[1,2,3]);
-        case(~[1,1,2,2,2,3,3], ~[1,2,3]);
+        case(vec![], vec![]);
+        case(vec![1], vec![1]);
+        case(vec![1,1], vec![1]);
+        case(vec![1,2,3], vec![1,2,3]);
+        case(vec![1,1,2,3], vec![1,2,3]);
+        case(vec![1,2,2,3], vec![1,2,3]);
+        case(vec![1,2,3,3], vec![1,2,3]);
+        case(vec![1,1,2,2,2,3,3], vec![1,2,3]);
     }
 
     #[test]
     fn test_dedup_unique() {
-        let mut v0 = ~[~1, ~1, ~2, ~3];
+        let mut v0 = vec![~1, ~1, ~2, ~3];
         v0.dedup();
-        let mut v1 = ~[~1, ~2, ~2, ~3];
+        let mut v1 = vec![~1, ~2, ~2, ~3];
         v1.dedup();
-        let mut v2 = ~[~1, ~2, ~3, ~3];
+        let mut v2 = vec![~1, ~2, ~3, ~3];
         v2.dedup();
         /*
          * If the ~pointers were leaked or otherwise misused, valgrind and/or
@@ -3309,11 +2708,11 @@ mod tests {
 
     #[test]
     fn test_dedup_shared() {
-        let mut v0 = ~[~1, ~1, ~2, ~3];
+        let mut v0 = vec![~1, ~1, ~2, ~3];
         v0.dedup();
-        let mut v1 = ~[~1, ~2, ~2, ~3];
+        let mut v1 = vec![~1, ~2, ~2, ~3];
         v1.dedup();
-        let mut v2 = ~[~1, ~2, ~3, ~3];
+        let mut v2 = vec![~1, ~2, ~3, ~3];
         v2.dedup();
         /*
          * If the pointers were leaked or otherwise misused, valgrind and/or
@@ -3323,14 +2722,14 @@ mod tests {
 
     #[test]
     fn test_retain() {
-        let mut v = ~[1, 2, 3, 4, 5];
+        let mut v = vec![1, 2, 3, 4, 5];
         v.retain(is_odd);
-        assert_eq!(v, ~[1, 3, 5]);
+        assert_eq!(v, vec![1, 3, 5]);
     }
 
     #[test]
     fn test_zip_unzip() {
-        let z1 = ~[(1, 4), (2, 5), (3, 6)];
+        let z1 = vec![(1, 4), (2, 5), (3, 6)];
 
         let (left, right) = unzip(z1.iter().map(|&x| x));
 
@@ -3559,9 +2958,9 @@ mod tests {
 
     #[test]
     fn test_shift() {
-        let mut x = ~[1, 2, 3];
+        let mut x = vec![1, 2, 3];
         assert_eq!(x.shift(), Some(1));
-        assert_eq!(&x, &~[2, 3]);
+        assert_eq!(&x, &vec![2, 3]);
         assert_eq!(x.shift(), Some(2));
         assert_eq!(x.shift(), Some(3));
         assert_eq!(x.shift(), None);
@@ -3570,55 +2969,55 @@ mod tests {
 
     #[test]
     fn test_unshift() {
-        let mut x = ~[1, 2, 3];
+        let mut x = vec![1, 2, 3];
         x.unshift(0);
-        assert_eq!(x, ~[0, 1, 2, 3]);
+        assert_eq!(x, vec![0, 1, 2, 3]);
     }
 
     #[test]
     fn test_insert() {
-        let mut a = ~[1, 2, 4];
+        let mut a = vec![1, 2, 4];
         a.insert(2, 3);
-        assert_eq!(a, ~[1, 2, 3, 4]);
+        assert_eq!(a, vec![1, 2, 3, 4]);
 
-        let mut a = ~[1, 2, 3];
+        let mut a = vec![1, 2, 3];
         a.insert(0, 0);
-        assert_eq!(a, ~[0, 1, 2, 3]);
+        assert_eq!(a, vec![0, 1, 2, 3]);
 
-        let mut a = ~[1, 2, 3];
+        let mut a = vec![1, 2, 3];
         a.insert(3, 4);
-        assert_eq!(a, ~[1, 2, 3, 4]);
+        assert_eq!(a, vec![1, 2, 3, 4]);
 
-        let mut a = ~[];
+        let mut a = vec![];
         a.insert(0, 1);
-        assert_eq!(a, ~[1]);
+        assert_eq!(a, vec![1]);
     }
 
     #[test]
     #[should_fail]
     fn test_insert_oob() {
-        let mut a = ~[1, 2, 3];
+        let mut a = vec![1, 2, 3];
         a.insert(4, 5);
     }
 
     #[test]
     fn test_remove() {
-        let mut a = ~[1,2,3,4];
+        let mut a = vec![1,2,3,4];
 
         assert_eq!(a.remove(2), Some(3));
-        assert_eq!(a, ~[1,2,4]);
+        assert_eq!(a, vec![1,2,4]);
 
         assert_eq!(a.remove(2), Some(4));
-        assert_eq!(a, ~[1,2]);
+        assert_eq!(a, vec![1,2]);
 
         assert_eq!(a.remove(2), None);
-        assert_eq!(a, ~[1,2]);
+        assert_eq!(a, vec![1,2]);
 
         assert_eq!(a.remove(0), Some(1));
-        assert_eq!(a, ~[2]);
+        assert_eq!(a, vec![2]);
 
         assert_eq!(a.remove(0), Some(2));
-        assert_eq!(a, ~[]);
+        assert_eq!(a, vec![]);
 
         assert_eq!(a.remove(0), None);
         assert_eq!(a.remove(10), None);
@@ -3626,17 +3025,17 @@ mod tests {
 
     #[test]
     fn test_capacity() {
-        let mut v = ~[0u64];
+        let mut v = vec![0u64];
         v.reserve_exact(10u);
         assert_eq!(v.capacity(), 10u);
-        let mut v = ~[0u32];
+        let mut v = vec![0u32];
         v.reserve_exact(10u);
         assert_eq!(v.capacity(), 10u);
     }
 
     #[test]
     fn test_slice_2() {
-        let v = ~[1, 2, 3, 4, 5];
+        let v = vec![1, 2, 3, 4, 5];
         let v = v.slice(1u, 3u);
         assert_eq!(v.len(), 2u);
         assert_eq!(v[0], 2);
@@ -3647,7 +3046,7 @@ mod tests {
     #[test]
     #[should_fail]
     fn test_from_fn_fail() {
-        from_fn(100, |v| {
+        Vec::from_fn(100, |v| {
             if v == 50 { fail!() }
             ~0
         });
@@ -3674,27 +3073,14 @@ mod tests {
         }
 
         let s = S { f: 0, boxes: (~0, Rc::new(0)) };
-        let _ = from_elem(100, s);
-    }
-
-    #[test]
-    #[should_fail]
-    fn test_build_fail() {
-        use rc::Rc;
-        build(None, |push| {
-            push((~0, Rc::new(0)));
-            push((~0, Rc::new(0)));
-            push((~0, Rc::new(0)));
-            push((~0, Rc::new(0)));
-            fail!();
-        });
+        let _ = Vec::from_elem(100, s);
     }
 
     #[test]
     #[should_fail]
     fn test_grow_fn_fail() {
         use rc::Rc;
-        let mut v = ~[];
+        let mut v = vec![];
         v.grow_fn(100, |i| {
             if i == 50 {
                 fail!()
@@ -4036,6 +3422,7 @@ mod tests {
 
         t!(&[int]);
         t!(~[int]);
+        t!(Vec<int>);
     }
 
     #[test]
@@ -4051,7 +3438,7 @@ mod tests {
     #[test]
     #[should_fail]
     fn test_overflow_does_not_cause_segfault() {
-        let mut v = ~[];
+        let mut v = vec![];
         v.reserve_exact(-1);
         v.push(1);
         v.push(2);
@@ -4061,7 +3448,7 @@ mod tests {
     #[should_fail]
     fn test_overflow_does_not_cause_segfault_managed() {
         use rc::Rc;
-        let mut v = ~[Rc::new(1)];
+        let mut v = vec![Rc::new(1)];
         v.reserve_exact(-1);
         v.push(Rc::new(2));
     }
@@ -4090,7 +3477,7 @@ mod tests {
 
     #[test]
     fn test_iter_zero_sized() {
-        let mut v = ~[Foo, Foo, Foo];
+        let mut v = vec![Foo, Foo, Foo];
         assert_eq!(v.len(), 3);
         let mut cnt = 0;
 
@@ -4118,7 +3505,7 @@ mod tests {
         }
         assert_eq!(cnt, 11);
 
-        let xs = ~[Foo, Foo, Foo];
+        let xs = vec![Foo, Foo, Foo];
         assert_eq!(format!("{:?}", xs.slice(0, 2).to_owned()),
                    ~"~[slice::tests::Foo, slice::tests::Foo]");
 
@@ -4135,14 +3522,14 @@ mod tests {
 
     #[test]
     fn test_shrink_to_fit() {
-        let mut xs = ~[0, 1, 2, 3];
+        let mut xs = vec![0, 1, 2, 3];
         for i in range(4, 100) {
             xs.push(i)
         }
         assert_eq!(xs.capacity(), 128);
         xs.shrink_to_fit();
         assert_eq!(xs.capacity(), 100);
-        assert_eq!(xs, range(0, 100).collect::<~[_]>());
+        assert_eq!(xs, range(0, 100).collect::<Vec<_>>());
     }
 
     #[test]
@@ -4300,13 +3687,12 @@ mod bench {
     use prelude::*;
     use ptr;
     use rand::{weak_rng, Rng};
-    use slice;
 
     #[bench]
     fn iterator(b: &mut Bencher) {
         // peculiar numbers to stop LLVM from optimising the summation
         // out.
-        let v = slice::from_fn(100, |i| i ^ (i << 1) ^ (i >> 1));
+        let v = Vec::from_fn(100, |i| i ^ (i << 1) ^ (i >> 1));
 
         b.iter(|| {
             let mut sum = 0;
@@ -4320,7 +3706,7 @@ mod bench {
 
     #[bench]
     fn mut_iterator(b: &mut Bencher) {
-        let mut v = slice::from_elem(100, 0);
+        let mut v = Vec::from_elem(100, 0);
 
         b.iter(|| {
             let mut i = 0;
@@ -4342,23 +3728,23 @@ mod bench {
 
     #[bench]
     fn concat(b: &mut Bencher) {
-        let xss: &[~[uint]] = slice::from_fn(100, |i| range(0, i).collect());
+        let xss: Vec<Vec<uint>> = Vec::from_fn(100, |i| range(0, i).collect());
         b.iter(|| {
-            let _ = xss.concat_vec();
+            xss.as_slice().concat_vec()
         });
     }
 
     #[bench]
     fn connect(b: &mut Bencher) {
-        let xss: &[~[uint]] = slice::from_fn(100, |i| range(0, i).collect());
+        let xss: Vec<Vec<uint>> = Vec::from_fn(100, |i| range(0, i).collect());
         b.iter(|| {
-            let _ = xss.connect_vec(&0);
+            xss.as_slice().connect_vec(&0)
         });
     }
 
     #[bench]
     fn push(b: &mut Bencher) {
-        let mut vec: ~[uint] = ~[0u];
+        let mut vec: Vec<uint> = vec![];
         b.iter(|| {
             vec.push(0);
             &vec
@@ -4367,59 +3753,59 @@ mod bench {
 
     #[bench]
     fn starts_with_same_vector(b: &mut Bencher) {
-        let vec: ~[uint] = slice::from_fn(100, |i| i);
+        let vec: Vec<uint> = Vec::from_fn(100, |i| i);
         b.iter(|| {
-            vec.starts_with(vec)
+            vec.as_slice().starts_with(vec.as_slice())
         })
     }
 
     #[bench]
     fn starts_with_single_element(b: &mut Bencher) {
-        let vec: ~[uint] = ~[0u];
+        let vec: Vec<uint> = vec![0];
         b.iter(|| {
-            vec.starts_with(vec)
+            vec.as_slice().starts_with(vec.as_slice())
         })
     }
 
     #[bench]
     fn starts_with_diff_one_element_at_end(b: &mut Bencher) {
-        let vec: ~[uint] = slice::from_fn(100, |i| i);
-        let mut match_vec: ~[uint] = slice::from_fn(99, |i| i);
+        let vec: Vec<uint> = Vec::from_fn(100, |i| i);
+        let mut match_vec: Vec<uint> = Vec::from_fn(99, |i| i);
         match_vec.push(0);
         b.iter(|| {
-            vec.starts_with(match_vec)
+            vec.as_slice().starts_with(match_vec.as_slice())
         })
     }
 
     #[bench]
     fn ends_with_same_vector(b: &mut Bencher) {
-        let vec: ~[uint] = slice::from_fn(100, |i| i);
+        let vec: Vec<uint> = Vec::from_fn(100, |i| i);
         b.iter(|| {
-            vec.ends_with(vec)
+            vec.as_slice().ends_with(vec.as_slice())
         })
     }
 
     #[bench]
     fn ends_with_single_element(b: &mut Bencher) {
-        let vec: ~[uint] = ~[0u];
+        let vec: Vec<uint> = vec![0];
         b.iter(|| {
-            vec.ends_with(vec)
+            vec.as_slice().ends_with(vec.as_slice())
         })
     }
 
     #[bench]
     fn ends_with_diff_one_element_at_beginning(b: &mut Bencher) {
-        let vec: ~[uint] = slice::from_fn(100, |i| i);
-        let mut match_vec: ~[uint] = slice::from_fn(100, |i| i);
-        match_vec[0] = 200;
+        let vec: Vec<uint> = Vec::from_fn(100, |i| i);
+        let mut match_vec: Vec<uint> = Vec::from_fn(100, |i| i);
+        match_vec.as_mut_slice()[0] = 200;
         b.iter(|| {
-            vec.starts_with(match_vec)
+            vec.as_slice().starts_with(match_vec.as_slice())
         })
     }
 
     #[bench]
     fn contains_last_element(b: &mut Bencher) {
-        let vec: ~[uint] = slice::from_fn(100, |i| i);
+        let vec: Vec<uint> = Vec::from_fn(100, |i| i);
         b.iter(|| {
             vec.contains(&99u)
         })
@@ -4428,14 +3814,14 @@ mod bench {
     #[bench]
     fn zero_1kb_from_elem(b: &mut Bencher) {
         b.iter(|| {
-            let _v: ~[u8] = slice::from_elem(1024, 0u8);
+            Vec::from_elem(1024, 0u8)
         });
     }
 
     #[bench]
     fn zero_1kb_set_memory(b: &mut Bencher) {
         b.iter(|| {
-            let mut v: ~[u8] = slice::with_capacity(1024);
+            let mut v: Vec<uint> = Vec::with_capacity(1024);
             unsafe {
                 let vp = v.as_mut_ptr();
                 ptr::set_memory(vp, 0, 1024);
@@ -4454,15 +3840,13 @@ mod bench {
 
     #[bench]
     fn zero_1kb_loop_set(b: &mut Bencher) {
-        // Slower because the { len, cap, [0 x T] }* repr allows a pointer to the length
-        // field to be aliased (in theory) and prevents LLVM from optimizing loads away.
         b.iter(|| {
-            let mut v: ~[u8] = slice::with_capacity(1024);
+            let mut v: Vec<uint> = Vec::with_capacity(1024);
             unsafe {
                 v.set_len(1024);
             }
             for i in range(0u, 1024) {
-                v[i] = 0;
+                *v.get_mut(i) = 0;
             }
         });
     }
@@ -4470,7 +3854,7 @@ mod bench {
     #[bench]
     fn zero_1kb_mut_iter(b: &mut Bencher) {
         b.iter(|| {
-            let mut v: ~[u8] = slice::with_capacity(1024);
+            let mut v = Vec::with_capacity(1024);
             unsafe {
                 v.set_len(1024);
             }
@@ -4485,7 +3869,7 @@ mod bench {
     fn random_inserts(b: &mut Bencher) {
         let mut rng = weak_rng();
         b.iter(|| {
-                let mut v = slice::from_elem(30, (0u, 0u));
+                let mut v = Vec::from_elem(30, (0u, 0u));
                 for _ in range(0, 100) {
                     let l = v.len();
                     v.insert(rng.gen::<uint>() % (l + 1),
@@ -4497,7 +3881,7 @@ mod bench {
     fn random_removes(b: &mut Bencher) {
         let mut rng = weak_rng();
         b.iter(|| {
-                let mut v = slice::from_elem(130, (0u, 0u));
+                let mut v = Vec::from_elem(130, (0u, 0u));
                 for _ in range(0, 100) {
                     let l = v.len();
                     v.remove(rng.gen::<uint>() % l);
@@ -4537,11 +3921,11 @@ mod bench {
 
     #[bench]
     fn sort_sorted(b: &mut Bencher) {
-        let mut v = slice::from_fn(10000, |i| i);
+        let mut v = Vec::from_fn(10000, |i| i);
         b.iter(|| {
             v.sort();
         });
-        b.bytes = (v.len() * mem::size_of_val(&v[0])) as u64;
+        b.bytes = (v.len() * mem::size_of_val(v.get(0))) as u64;
     }
 
     type BigSortable = (u64,u64,u64,u64);
@@ -4578,10 +3962,10 @@ mod bench {
 
     #[bench]
     fn sort_big_sorted(b: &mut Bencher) {
-        let mut v = slice::from_fn(10000u, |i| (i, i, i, i));
+        let mut v = Vec::from_fn(10000u, |i| (i, i, i, i));
         b.iter(|| {
             v.sort();
         });
-        b.bytes = (v.len() * mem::size_of_val(&v[0])) as u64;
+        b.bytes = (v.len() * mem::size_of_val(v.get(0))) as u64;
     }
 }
diff --git a/src/libstd/str.rs b/src/libstd/str.rs
index 449329ce63a..ed4a8c652f7 100644
--- a/src/libstd/str.rs
+++ b/src/libstd/str.rs
@@ -80,7 +80,7 @@ use char;
 use char::Char;
 use clone::Clone;
 use cmp::{Eq, TotalEq, Ord, TotalOrd, Equiv, Ordering};
-use container::{Container, Mutable};
+use container::Container;
 use fmt;
 use io::Writer;
 use iter::{Iterator, FromIterator, Extendable, range};
@@ -92,7 +92,7 @@ use option::{None, Option, Some};
 use ptr;
 use from_str::FromStr;
 use slice;
-use slice::{OwnedVector, OwnedCloneableVector, ImmutableVector, MutableVector};
+use slice::{OwnedVector, ImmutableVector, MutableVector};
 use slice::{Vector};
 use vec::Vec;
 use default::Default;
@@ -588,7 +588,7 @@ enum NormalizationForm {
 pub struct Normalizations<'a> {
     kind: NormalizationForm,
     iter: Chars<'a>,
-    buffer: ~[(char, u8)],
+    buffer: Vec<(char, u8)>,
     sorted: bool
 }
 
@@ -597,7 +597,7 @@ impl<'a> Iterator<char> for Normalizations<'a> {
     fn next(&mut self) -> Option<char> {
         use unicode::decompose::canonical_combining_class;
 
-        match self.buffer.head() {
+        match self.buffer.as_slice().head() {
             Some(&(c, 0)) => {
                 self.sorted = false;
                 self.buffer.shift();
@@ -622,7 +622,7 @@ impl<'a> Iterator<char> for Normalizations<'a> {
                 decomposer(ch, |d| {
                     let class = canonical_combining_class(d);
                     if class == 0 && !*sorted {
-                        canonical_sort(*buffer);
+                        canonical_sort(buffer.as_mut_slice());
                         *sorted = true;
                     }
                     buffer.push((d, class));
@@ -632,7 +632,7 @@ impl<'a> Iterator<char> for Normalizations<'a> {
         }
 
         if !self.sorted {
-            canonical_sort(self.buffer);
+            canonical_sort(self.buffer.as_mut_slice());
             self.sorted = true;
         }
 
@@ -1336,22 +1336,23 @@ impl<'a> fmt::Show for MaybeOwned<'a> {
 pub mod raw {
     use cast;
     use container::Container;
+    use iter::Iterator;
     use libc;
-    use ptr;
     use ptr::RawPtr;
-    use str::{is_utf8, OwnedStr, StrSlice};
-    use slice;
-    use slice::{MutableVector, ImmutableVector, OwnedVector};
+    use ptr;
     use raw::Slice;
+    use slice::{MutableVector, ImmutableVector, OwnedVector, Vector};
+    use str::{is_utf8, StrSlice};
+    use vec::Vec;
 
     /// Create a Rust string from a *u8 buffer of the given length
     pub unsafe fn from_buf_len(buf: *u8, len: uint) -> ~str {
-        let mut v: ~[u8] = slice::with_capacity(len);
+        let mut v = Vec::with_capacity(len);
         ptr::copy_memory(v.as_mut_ptr(), buf, len);
         v.set_len(len);
 
-        assert!(is_utf8(v));
-        ::cast::transmute(v)
+        assert!(is_utf8(v.as_slice()));
+        ::cast::transmute(v.move_iter().collect::<~[u8]>())
     }
 
     #[lang="strdup_uniq"]
@@ -1594,16 +1595,6 @@ impl Container for ~str {
     fn len(&self) -> uint { self.as_slice().len() }
 }
 
-impl Mutable for ~str {
-    /// Remove all content, make the string empty
-    #[inline]
-    fn clear(&mut self) {
-        unsafe {
-            self.set_len(0)
-        }
-    }
-}
-
 /// Methods for string slices
 pub trait StrSlice<'a> {
     /// Returns true if one string contains another
@@ -2396,7 +2387,7 @@ impl<'a> StrSlice<'a> for &'a str {
     fn nfd_chars(&self) -> Normalizations<'a> {
         Normalizations {
             iter: self.chars(),
-            buffer: ~[],
+            buffer: Vec::new(),
             sorted: false,
             kind: NFD
         }
@@ -2406,7 +2397,7 @@ impl<'a> StrSlice<'a> for &'a str {
     fn nfkd_chars(&self) -> Normalizations<'a> {
         Normalizations {
             iter: self.chars(),
-            buffer: ~[],
+            buffer: Vec::new(),
             sorted: false,
             kind: NFKD
         }
@@ -2544,22 +2535,22 @@ impl<'a> StrSlice<'a> for &'a str {
     fn to_owned(&self) -> ~str {
         let len = self.len();
         unsafe {
-            let mut v = slice::with_capacity(len);
+            let mut v = Vec::with_capacity(len);
 
             ptr::copy_memory(v.as_mut_ptr(), self.as_ptr(), len);
             v.set_len(len);
-            ::cast::transmute(v)
+            ::cast::transmute(v.move_iter().collect::<~[u8]>())
         }
     }
 
     fn to_utf16(&self) -> ~[u16] {
-        let mut u = ~[];
+        let mut u = Vec::new();;
         for ch in self.chars() {
             let mut buf = [0u16, ..2];
             let n = ch.encode_utf16(buf /* as mut slice! */);
             u.push_all(buf.slice_to(n));
         }
-        u
+        u.move_iter().collect()
     }
 
     #[inline]
@@ -2694,29 +2685,30 @@ impl<'a> StrSlice<'a> for &'a str {
         if slen == 0 { return tlen; }
         if tlen == 0 { return slen; }
 
-        let mut dcol = slice::from_fn(tlen + 1, |x| x);
+        let mut dcol = Vec::from_fn(tlen + 1, |x| x);
 
         for (i, sc) in self.chars().enumerate() {
 
             let mut current = i;
-            dcol[0] = current + 1;
+            *dcol.get_mut(0) = current + 1;
 
             for (j, tc) in t.chars().enumerate() {
 
-                let next = dcol[j + 1];
+                let next = *dcol.get(j + 1);
 
                 if sc == tc {
-                    dcol[j + 1] = current;
+                    *dcol.get_mut(j + 1) = current;
                 } else {
-                    dcol[j + 1] = ::cmp::min(current, next);
-                    dcol[j + 1] = ::cmp::min(dcol[j + 1], dcol[j]) + 1;
+                    *dcol.get_mut(j + 1) = ::cmp::min(current, next);
+                    *dcol.get_mut(j + 1) = ::cmp::min(*dcol.get(j + 1),
+                                                      *dcol.get(j)) + 1;
                 }
 
                 current = next;
             }
         }
 
-        return dcol[tlen];
+        return *dcol.get(tlen);
     }
 
     fn subslice_offset(&self, inner: &str) -> uint {
@@ -2738,44 +2730,22 @@ impl<'a> StrSlice<'a> for &'a str {
 
 /// Methods for owned strings
 pub trait OwnedStr {
-    /// Shorten a string to the specified length (which must be <= the current length)
-    fn truncate(&mut self, len: uint);
-
     /// Consumes the string, returning the underlying byte buffer.
     ///
     /// The buffer does not have a null terminator.
     fn into_bytes(self) -> ~[u8];
 
-    /// Sets the length of a string
-    ///
-    /// This will explicitly set the size of the string, without actually
-    /// modifying its buffers, so it is up to the caller to ensure that
-    /// the string is actually the specified size.
-    unsafe fn set_len(&mut self, new_len: uint);
-
     /// Pushes the given string onto this string, returning the concatenation of the two strings.
     fn append(self, rhs: &str) -> ~str;
 }
 
 impl OwnedStr for ~str {
     #[inline]
-    fn truncate(&mut self, len: uint) {
-        assert!(len <= self.len());
-        assert!(self.is_char_boundary(len));
-        unsafe { self.set_len(len); }
-    }
-
-    #[inline]
     fn into_bytes(self) -> ~[u8] {
         unsafe { cast::transmute(self) }
     }
 
     #[inline]
-    unsafe fn set_len(&mut self, new_len: uint) {
-        raw::as_owned_vec(self).set_len(new_len)
-    }
-
-    #[inline]
     fn append(self, rhs: &str) -> ~str {
         let mut new_str = StrBuf::from_owned_str(self);
         new_str.push_str(rhs);
@@ -3409,8 +3379,7 @@ mod tests {
         assert_eq!(a.subslice_offset(c), 0);
 
         let string = "a\nb\nc";
-        let mut lines = ~[];
-        for line in string.lines() { lines.push(line) }
+        let lines: ~[&str] = string.lines().collect();
         assert_eq!(string.subslice_offset(lines[0]), 0);
         assert_eq!(string.subslice_offset(lines[1]), 2);
         assert_eq!(string.subslice_offset(lines[2]), 4);
@@ -4259,9 +4228,9 @@ mod bench {
 
     #[bench]
     fn from_utf8_lossy_100_invalid(b: &mut Bencher) {
-        let s = ::slice::from_elem(100, 0xF5u8);
+        let s = Vec::from_elem(100, 0xF5u8);
         b.iter(|| {
-            let _ = from_utf8_lossy(s);
+            let _ = from_utf8_lossy(s.as_slice());
         });
     }
 
diff --git a/src/libstd/sync/arc.rs b/src/libstd/sync/arc.rs
index 0d0bd740e41..498a6252a8f 100644
--- a/src/libstd/sync/arc.rs
+++ b/src/libstd/sync/arc.rs
@@ -23,12 +23,13 @@
 
 use cast;
 use clone::Clone;
+use iter::Iterator;
 use kinds::Send;
 use ops::Drop;
 use ptr::RawPtr;
 use sync::atomics::{fence, AtomicUint, Relaxed, Acquire, Release};
-use slice;
 use ty::Unsafe;
+use vec::Vec;
 
 /// An atomically reference counted pointer.
 ///
@@ -73,7 +74,8 @@ impl<T: Send> UnsafeArc<T> {
                 ~[] // need to free data here
             } else {
                 let ptr = new_inner(data, num_handles);
-                slice::from_fn(num_handles, |_| UnsafeArc { data: ptr })
+                let v = Vec::from_fn(num_handles, |_| UnsafeArc { data: ptr });
+                v.move_iter().collect()
             }
         }
     }
diff --git a/src/libstd/sync/deque.rs b/src/libstd/sync/deque.rs
index 8beadce2160..97239707d32 100644
--- a/src/libstd/sync/deque.rs
+++ b/src/libstd/sync/deque.rs
@@ -61,7 +61,7 @@ use ptr::RawPtr;
 use sync::arc::UnsafeArc;
 use sync::atomics::{AtomicInt, AtomicPtr, SeqCst};
 use unstable::sync::Exclusive;
-use slice::{OwnedVector, ImmutableVector};
+use slice::ImmutableVector;
 use vec::Vec;
 
 // Once the queue is less than 1/K full, then it will be downsized. Note that
diff --git a/src/libstd/unstable/sync.rs b/src/libstd/unstable/sync.rs
index f1dd7aa150b..b7f6d730d12 100644
--- a/src/libstd/unstable/sync.rs
+++ b/src/libstd/unstable/sync.rs
@@ -115,7 +115,7 @@ mod tests {
     #[test]
     fn exclusive_new_arc() {
         unsafe {
-            let mut futures = ~[];
+            let mut futures = Vec::new();
 
             let num_tasks = 10;
             let count = 10;
diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs
index 96cbac8869e..5480805478c 100644
--- a/src/libstd/vec.rs
+++ b/src/libstd/vec.rs
@@ -614,13 +614,9 @@ impl<T> Vec<T> {
     /// ```
     #[inline]
     pub fn as_mut_slice<'a>(&'a mut self) -> &'a mut [T] {
-        // See the comment in as_slice() for what's going on here.
-        let slice = if mem::size_of::<T>() == 0 {
-            Slice { data: 1 as *T, len: self.len }
-        } else {
-            Slice { data: self.ptr as *T, len: self.len }
-        };
-        unsafe { transmute(slice) }
+        unsafe {
+            transmute(Slice { data: self.as_mut_ptr() as *T, len: self.len })
+        }
     }
 
     /// Creates a consuming iterator, that is, one that moves each
@@ -1143,7 +1139,15 @@ impl<T> Vec<T> {
     /// would also make any pointers to it invalid.
     #[inline]
     pub fn as_ptr(&self) -> *T {
-        self.as_slice().as_ptr()
+        // If we have a 0-sized vector, then the base pointer should not be NULL
+        // because an iterator over the slice will attempt to yield the base
+        // pointer as the first element in the vector, but this will end up
+        // being Some(NULL) which is optimized to None.
+        if mem::size_of::<T>() == 0 {
+            1 as *T
+        } else {
+            self.ptr as *T
+        }
     }
 
     /// Returns a mutable unsafe pointer to the vector's buffer.
@@ -1155,7 +1159,12 @@ impl<T> Vec<T> {
     /// would also make any pointers to it invalid.
     #[inline]
     pub fn as_mut_ptr(&mut self) -> *mut T {
-        self.as_mut_slice().as_mut_ptr()
+        // see above for the 0-size check
+        if mem::size_of::<T>() == 0 {
+            1 as *mut T
+        } else {
+            self.ptr
+        }
     }
 
     /// Retains only the elements specified by the predicate.
@@ -1356,16 +1365,7 @@ impl<T> Vector<T> for Vec<T> {
     /// ```
     #[inline]
     fn as_slice<'a>(&'a self) -> &'a [T] {
-        // If we have a 0-sized vector, then the base pointer should not be NULL
-        // because an iterator over the slice will attempt to yield the base
-        // pointer as the first element in the vector, but this will end up
-        // being Some(NULL) which is optimized to None.
-        let slice = if mem::size_of::<T>() == 0 {
-            Slice { data: 1 as *T, len: self.len }
-        } else {
-            Slice { data: self.ptr as *T, len: self.len }
-        };
-        unsafe { transmute(slice) }
+        unsafe { transmute(Slice { data: self.as_ptr(), len: self.len }) }
     }
 }
 
diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs
index 86c7ae28ac2..84021f6362b 100644
--- a/src/libsyntax/ext/format.rs
+++ b/src/libsyntax/ext/format.rs
@@ -20,7 +20,6 @@ use rsparse = parse;
 
 use std::fmt::parse;
 use collections::{HashMap, HashSet};
-use std::slice;
 
 #[deriving(Eq)]
 enum ArgumentType {
@@ -609,7 +608,7 @@ impl<'a, 'b> Context<'a, 'b> {
     fn to_expr(&self, extra: @ast::Expr) -> @ast::Expr {
         let mut lets = Vec::new();
         let mut locals = Vec::new();
-        let mut names = slice::from_fn(self.name_positions.len(), |_| None);
+        let mut names = Vec::from_fn(self.name_positions.len(), |_| None);
         let mut pats = Vec::new();
         let mut heads = Vec::new();
 
@@ -673,7 +672,7 @@ impl<'a, 'b> Context<'a, 'b> {
             let lname = self.ecx.ident_of(format!("__arg{}", *name));
             pats.push(self.ecx.pat_ident(e.span, lname));
             heads.push(self.ecx.expr_addr_of(e.span, e));
-            names[*self.name_positions.get(name)] =
+            *names.get_mut(*self.name_positions.get(name)) =
                 Some(self.format_arg(e.span,
                                      Named((*name).clone()),
                                      self.ecx.expr_ident(e.span, lname)));
diff --git a/src/test/bench/core-map.rs b/src/test/bench/core-map.rs
index 9f91284a413..4405245b9a0 100644
--- a/src/test/bench/core-map.rs
+++ b/src/test/bench/core-map.rs
@@ -16,7 +16,6 @@ use collections::{TrieMap, TreeMap, HashMap, HashSet};
 use std::os;
 use rand::{Rng, IsaacRng, SeedableRng};
 use std::uint;
-use std::slice;
 
 fn timed(label: &str, f: ||) {
     let start = time::precise_time_s();
@@ -99,7 +98,7 @@ fn main() {
         }
     };
 
-    let mut rand = slice::with_capacity(n_keys);
+    let mut rand = Vec::with_capacity(n_keys);
 
     {
         let mut rng: IsaacRng = SeedableRng::from_seed(&[1, 1, 1, 1, 1, 1, 1]);
@@ -130,7 +129,7 @@ fn main() {
     {
         println!(" Random integers:");
         let mut map: TreeMap<uint,uint> = TreeMap::new();
-        vector(&mut map, n_keys, rand);
+        vector(&mut map, n_keys, rand.as_slice());
     }
 
     // FIXME: #9970
@@ -149,7 +148,7 @@ fn main() {
     {
         println!(" Random integers:");
         let mut map: HashMap<uint,uint> = HashMap::new();
-        vector(&mut map, n_keys, rand);
+        vector(&mut map, n_keys, rand.as_slice());
     }
 
     // FIXME: #9970
@@ -168,6 +167,6 @@ fn main() {
     {
         println!(" Random integers:");
         let mut map: TrieMap<uint> = TrieMap::new();
-        vector(&mut map, n_keys, rand);
+        vector(&mut map, n_keys, rand.as_slice());
     }
 }
diff --git a/src/test/bench/shootout-fannkuch-redux.rs b/src/test/bench/shootout-fannkuch-redux.rs
index e650367c6f5..fbea63e65f1 100644
--- a/src/test/bench/shootout-fannkuch-redux.rs
+++ b/src/test/bench/shootout-fannkuch-redux.rs
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 use std::os;
-use std::slice;
 
 fn max(a: i32, b: i32) -> i32 {
     if a > b {
@@ -20,13 +19,17 @@ fn max(a: i32, b: i32) -> i32 {
 }
 
 fn fannkuch_redux(n: i32) -> i32 {
-    let mut perm = slice::from_elem(n as uint, 0i32);
-    let mut perm1 = slice::from_fn(n as uint, |i| i as i32);
-    let mut count = slice::from_elem(n as uint, 0i32);
+    let mut perm = Vec::from_elem(n as uint, 0i32);
+    let mut perm1 = Vec::from_fn(n as uint, |i| i as i32);
+    let mut count = Vec::from_elem(n as uint, 0i32);
     let mut max_flips_count = 0i32;
     let mut perm_count = 0i32;
     let mut checksum = 0i32;
 
+    let perm = perm.as_mut_slice();
+    let perm1 = perm1.as_mut_slice();
+    let count = count.as_mut_slice();
+
     let mut r = n;
     loop {
         while r != 1 {
diff --git a/src/test/bench/shootout-fasta-redux.rs b/src/test/bench/shootout-fasta-redux.rs
index f05f80a20d7..01b75fa422f 100644
--- a/src/test/bench/shootout-fasta-redux.rs
+++ b/src/test/bench/shootout-fasta-redux.rs
@@ -12,7 +12,6 @@ use std::cmp::min;
 use std::io::{stdout, IoResult};
 use std::os;
 use std::slice::bytes::copy_memory;
-use std::slice;
 
 static LINE_LEN: uint = 60;
 static LOOKUP_SIZE: uint = 4 * 1024;
@@ -90,10 +89,10 @@ impl<'a, W: Writer> RepeatFasta<'a, W> {
 
     fn make(&mut self, n: uint) -> IoResult<()> {
         let alu_len = self.alu.len();
-        let mut buf = slice::from_elem(alu_len + LINE_LEN, 0u8);
+        let mut buf = Vec::from_elem(alu_len + LINE_LEN, 0u8);
         let alu: &[u8] = self.alu.as_bytes();
 
-        copy_memory(buf, alu);
+        copy_memory(buf.as_mut_slice(), alu);
         let buf_len = buf.len();
         copy_memory(buf.mut_slice(alu_len, buf_len),
                     alu.slice_to(LINE_LEN));
diff --git a/src/test/bench/shootout-spectralnorm.rs b/src/test/bench/shootout-spectralnorm.rs
index 939f8eaab68..f0cdc020dc3 100644
--- a/src/test/bench/shootout-spectralnorm.rs
+++ b/src/test/bench/shootout-spectralnorm.rs
@@ -14,7 +14,6 @@ use std::from_str::FromStr;
 use std::iter::count;
 use std::cmp::min;
 use std::os;
-use std::slice::from_elem;
 use sync::{Arc, RWLock};
 
 fn A(i: uint, j: uint) -> f64 {
diff --git a/src/test/compile-fail/lint-deprecated-owned-vector.rs b/src/test/compile-fail/lint-deprecated-owned-vector.rs
index acc916a0391..537f3c9f48a 100644
--- a/src/test/compile-fail/lint-deprecated-owned-vector.rs
+++ b/src/test/compile-fail/lint-deprecated-owned-vector.rs
@@ -13,5 +13,4 @@
 fn main() {
     ~[1]; //~ ERROR use of deprecated `~[]`
     //~^ ERROR use of deprecated `~[]`
-    std::slice::with_capacity::<int>(10); //~ ERROR use of deprecated `~[]`
 }
diff --git a/src/test/compile-fail/lint-unused-imports.rs b/src/test/compile-fail/lint-unused-imports.rs
index a25b211e481..3a4844301d6 100644
--- a/src/test/compile-fail/lint-unused-imports.rs
+++ b/src/test/compile-fail/lint-unused-imports.rs
@@ -29,7 +29,12 @@ use test::B;
 
 // Make sure this import is warned about when at least one of its imported names
 // is unused
-use std::slice::{from_fn, from_elem};   //~ ERROR unused import
+use test2::{foo, bar}; //~ ERROR unused import
+
+mod test2 {
+    pub fn foo() {}
+    pub fn bar() {}
+}
 
 mod test {
     pub trait A { fn a(&self) {} }
@@ -66,5 +71,5 @@ fn main() {
     let mut b = 4;
     swap(&mut a, &mut b);
     test::C.b();
-    let _a = from_elem(0, 0);
+    let _a = foo();
 }
diff --git a/src/test/run-pass/backtrace.rs b/src/test/run-pass/backtrace.rs
index 1ba37217ea2..bf4e15c7ef5 100644
--- a/src/test/run-pass/backtrace.rs
+++ b/src/test/run-pass/backtrace.rs
@@ -36,7 +36,7 @@ fn double() {
 }
 
 fn runtest(me: &str) {
-    let mut env = os::env();
+    let mut env = os::env().move_iter().collect::<Vec<(~str, ~str)>>();
     match env.iter().position(|&(ref s, _)| "RUST_BACKTRACE" == *s) {
         Some(i) => { env.remove(i); }
         None => {}