about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-03-07 21:49:43 -0500
committerAlex Crichton <alex@alexcrichton.com>2013-03-08 09:54:41 -0500
commit2c87920f5274ad2df2071ba295e533d606780cf6 (patch)
tree1f12eb8abed67a0e7b15ff4507e7b97db2f303b1 /src
parent7f99a02ddb3ff30388ae1dd5db06e332c215fea2 (diff)
downloadrust-2c87920f5274ad2df2071ba295e533d606780cf6.tar.gz
rust-2c87920f5274ad2df2071ba295e533d606780cf6.zip
test: Removing dvec uses
Diffstat (limited to 'src')
-rw-r--r--src/librustc/middle/astencode.rs2
-rw-r--r--src/test/auxiliary/cci_nested_lib.rs8
-rw-r--r--src/test/auxiliary/issue-2631-a.rs3
-rw-r--r--src/test/bench/core-vec-append.rs76
-rw-r--r--src/test/compile-fail/issue-2590.rs6
-rw-r--r--src/test/run-pass/call-closure-from-overloaded-op.rs2
-rw-r--r--src/test/run-pass/dvec-index-op.rs16
-rw-r--r--src/test/run-pass/dvec-test.rs36
-rw-r--r--src/test/run-pass/issue-2631-b.rs2
9 files changed, 9 insertions, 142 deletions
diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs
index 1be8112fc80..6f0bfbb197f 100644
--- a/src/librustc/middle/astencode.rs
+++ b/src/librustc/middle/astencode.rs
@@ -25,7 +25,6 @@ use middle::{ty, typeck, moves};
 use middle;
 use util::ppaux::ty_to_str;
 
-use core::{io, option, vec};
 use std::ebml::reader;
 use std::ebml;
 use std::serialize;
@@ -1210,6 +1209,7 @@ fn mk_ctxt() -> fake_ext_ctxt {
 
 #[cfg(test)]
 fn roundtrip(in_item: Option<@ast::item>) {
+    use core::io;
     use std::prettyprint;
 
     let in_item = in_item.get();
diff --git a/src/test/auxiliary/cci_nested_lib.rs b/src/test/auxiliary/cci_nested_lib.rs
index a818ff58f94..ab9dc29441a 100644
--- a/src/test/auxiliary/cci_nested_lib.rs
+++ b/src/test/auxiliary/cci_nested_lib.rs
@@ -10,11 +10,9 @@
 
 #[legacy_modes];
 
-use core::dvec::DVec;
-
 pub struct Entry<A,B> {key: A, value: B}
 
-pub struct alist<A,B> { eq_fn: @fn(A,A) -> bool, data: DVec<Entry<A,B>> }
+pub struct alist<A,B> { eq_fn: @fn(A,A) -> bool, data: @mut ~[Entry<A,B>] }
 
 pub fn alist_add<A:Copy,B:Copy>(lst: alist<A,B>, k: A, v: B) {
     lst.data.push(Entry{key:k, value:v});
@@ -31,12 +29,12 @@ pub fn alist_get<A:Copy,B:Copy>(lst: alist<A,B>, k: A) -> B {
 #[inline]
 pub fn new_int_alist<B:Copy>() -> alist<int, B> {
     fn eq_int(&&a: int, &&b: int) -> bool { a == b }
-    return alist {eq_fn: eq_int, data: DVec()};
+    return alist {eq_fn: eq_int, data: @mut ~[]};
 }
 
 #[inline]
 pub fn new_int_alist_2<B:Copy>() -> alist<int, B> {
     #[inline]
     fn eq_int(&&a: int, &&b: int) -> bool { a == b }
-    return alist {eq_fn: eq_int, data: DVec()};
+    return alist {eq_fn: eq_int, data: @mut ~[]};
 }
diff --git a/src/test/auxiliary/issue-2631-a.rs b/src/test/auxiliary/issue-2631-a.rs
index b1fb7a82c5c..f7788c7d57a 100644
--- a/src/test/auxiliary/issue-2631-a.rs
+++ b/src/test/auxiliary/issue-2631-a.rs
@@ -13,10 +13,9 @@
 
 extern mod std;
 
-use core::dvec::*;
 use std::oldmap::HashMap;
 
-pub type header_map = HashMap<~str, @DVec<@~str>>;
+pub type header_map = HashMap<~str, @mut ~[@~str]>;
 
 // the unused ty param is necessary so this gets monomorphized
 pub fn request<T:Copy>(req: header_map) {
diff --git a/src/test/bench/core-vec-append.rs b/src/test/bench/core-vec-append.rs
deleted file mode 100644
index 4117add8926..00000000000
--- a/src/test/bench/core-vec-append.rs
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// A raw test of vector appending performance.
-
-extern mod std;
-use core::dvec::DVec;
-use core::io::WriterUtil;
-
-fn collect_raw(num: uint) -> ~[uint] {
-    let mut result = ~[];
-    for uint::range(0u, num) |i| {
-        result.push(i);
-    }
-    return result;
-}
-
-fn collect_dvec(num: uint) -> ~[uint] {
-    let result = DVec();
-    for uint::range(0u, num) |i| {
-        result.push(i);
-    }
-    return dvec::unwrap(result);
-}
-
-fn main() {
-    let args = os::args();
-    let args = if os::getenv(~"RUST_BENCH").is_some() {
-        ~[~"", ~"50000000"]
-    } else if args.len() <= 1u {
-        ~[~"", ~"100000"]
-    } else {
-        args
-    };
-    let max = uint::from_str(args[1]).get();
-    let start = std::time::precise_time_s();
-    let raw_v = collect_raw(max);
-    let mid = std::time::precise_time_s();
-    let dvec_v = collect_dvec(max);
-    let end = std::time::precise_time_s();
-
-    // check each vector
-    fail_unless!(raw_v.len() == max);
-    for raw_v.eachi |i, v| { fail_unless!(i == *v); }
-    fail_unless!(dvec_v.len() == max);
-    for dvec_v.eachi |i, v| { fail_unless!(i == *v); }
-
-    let raw = mid - start;
-    let dvec = end - mid;
-
-    let maxf = max as float;
-    let rawf = raw as float;
-    let dvecf = dvec as float;
-    
-    io::stdout().write_str(fmt!("Raw     : %? seconds\n", raw));
-    io::stdout().write_str(fmt!("        : %f op/sec\n", maxf/rawf));
-    io::stdout().write_str(fmt!("\n"));
-    io::stdout().write_str(fmt!("Dvec    : %? seconds\n", dvec));
-    io::stdout().write_str(fmt!("        : %f op/sec\n", maxf/dvecf));
-    io::stdout().write_str(fmt!("\n"));
-    
-    if dvec < raw {
-        io::stdout().write_str(fmt!("Dvec is %f%% faster than raw\n",
-                                    (rawf - dvecf) / rawf * 100.0));
-    } else {
-        io::stdout().write_str(fmt!("Raw is %f%% faster than dvec\n",
-                                    (dvecf - rawf) / dvecf * 100.0));
-    }
-}
diff --git a/src/test/compile-fail/issue-2590.rs b/src/test/compile-fail/issue-2590.rs
index 1de311f4de5..5f26adfcdc7 100644
--- a/src/test/compile-fail/issue-2590.rs
+++ b/src/test/compile-fail/issue-2590.rs
@@ -8,10 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use core::dvec::DVec;
-
 struct parser {
-    tokens: DVec<int>,
+    tokens: ~[int],
 }
 
 trait parse {
@@ -20,7 +18,7 @@ trait parse {
 
 impl parse for parser {
     fn parse() -> ~[int] {
-        ::core::dvec::unwrap(self.tokens) //~ ERROR moving out of immutable field
+        self.tokens //~ ERROR moving out of immutable field
     }
 }
 
diff --git a/src/test/run-pass/call-closure-from-overloaded-op.rs b/src/test/run-pass/call-closure-from-overloaded-op.rs
index 9d2c6f23198..cbfae48302b 100644
--- a/src/test/run-pass/call-closure-from-overloaded-op.rs
+++ b/src/test/run-pass/call-closure-from-overloaded-op.rs
@@ -11,7 +11,7 @@
 fn foo() -> int { 22 }
 
 pub fn main() {
-    let x = dvec::DVec::<@fn() -> int>();
+    let x: ~[@fn() -> int] = ~[];
     x.push(foo);
     fail_unless!((x[0])() == 22);
 }
diff --git a/src/test/run-pass/dvec-index-op.rs b/src/test/run-pass/dvec-index-op.rs
deleted file mode 100644
index e061464c7b2..00000000000
--- a/src/test/run-pass/dvec-index-op.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-pub fn main() {
-    let x = dvec::DVec();
-    x.push(1);
-    io::println(fmt!("%d", x[0]));
-}
-
diff --git a/src/test/run-pass/dvec-test.rs b/src/test/run-pass/dvec-test.rs
deleted file mode 100644
index dff37af9a59..00000000000
--- a/src/test/run-pass/dvec-test.rs
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-pub fn main() {
-    let d = dvec::DVec();
-    d.push(3);
-    d.push(4);
-    fail_unless!(d.get() == ~[3, 4]);
-    d.set(~[5]);
-    d.push(6);
-    d.push(7);
-    d.push(8);
-    d.push(9);
-    d.push(10);
-    d.push_all(~[11, 12, 13]);
-    d.push_slice(~[11, 12, 13], 1u, 2u);
-
-    let exp = ~[5, 6, 7, 8, 9, 10, 11, 12, 13, 12];
-    fail_unless!(d.get() == exp);
-    fail_unless!(d.get() == exp);
-    fail_unless!(d.len() == exp.len());
-
-    for d.eachi |i, e| {
-        fail_unless!(*e == exp[i]);
-    }
-
-    let v = dvec::unwrap(d);
-    fail_unless!(v == exp);
-}
diff --git a/src/test/run-pass/issue-2631-b.rs b/src/test/run-pass/issue-2631-b.rs
index 79c884f869f..66383253f7c 100644
--- a/src/test/run-pass/issue-2631-b.rs
+++ b/src/test/run-pass/issue-2631-b.rs
@@ -21,6 +21,6 @@ use std::oldmap::HashMap;
 pub fn main() {
   let v = ~[@~"hi"];
   let m: req::header_map = HashMap();
-  m.insert(~"METHOD", @dvec::from_vec(v));
+  m.insert(~"METHOD", @mut ~[v]);
   request::<int>(m);
 }