about summary refs log tree commit diff
path: root/src/test/bench
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-05-05 18:56:44 -0700
committerPatrick Walton <pcwalton@mimiga.net>2014-05-06 23:12:54 -0700
commit090040bf4037a094e50b03d79e4baf5cd89c912b (patch)
tree27fa91d623889d59260d3db167abdfa8c4288849 /src/test/bench
parent24f6f26e633e50b5b59f9d0f6cca0b1e49e215d9 (diff)
librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, except
for `~str`/`~[]`.

Note that `~self` still remains, since I forgot to add support for
`Box<self>` before the snapshot.

How to update your code:

* Instead of `~EXPR`, you should write `box EXPR`.

* Instead of `~TYPE`, you should write `Box<Type>`.

* Instead of `~PATTERN`, you should write `box PATTERN`.

[breaking-change]
Diffstat (limited to 'src/test/bench')
-rw-r--r--src/test/bench/shootout-k-nucleotide-pipes.rs4
-rw-r--r--src/test/bench/shootout-k-nucleotide.rs10
-rw-r--r--src/test/bench/shootout-regex-dna.rs4
-rw-r--r--src/test/bench/sudoku.rs4
-rw-r--r--src/test/bench/task-perf-alloc-unwind.rs14
5 files changed, 18 insertions, 18 deletions
diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs
index dd6e504f1de..659270b5554 100644
--- a/src/test/bench/shootout-k-nucleotide-pipes.rs
+++ b/src/test/bench/shootout-k-nucleotide-pipes.rs
@@ -147,9 +147,9 @@ fn main() {
 
     let rdr = if os::getenv("RUST_BENCH").is_some() {
         let foo = include_bin!("shootout-k-nucleotide.data");
-        ~MemReader::new(Vec::from_slice(foo)) as ~Reader
+        box MemReader::new(Vec::from_slice(foo)) as Box<Reader>
     } else {
-        ~stdio::stdin() as ~Reader
+        box stdio::stdin() as Box<Reader>
     };
     let mut rdr = BufferedReader::new(rdr);
 
diff --git a/src/test/bench/shootout-k-nucleotide.rs b/src/test/bench/shootout-k-nucleotide.rs
index 865b3a03726..dfa287459f3 100644
--- a/src/test/bench/shootout-k-nucleotide.rs
+++ b/src/test/bench/shootout-k-nucleotide.rs
@@ -91,16 +91,16 @@ impl TableCallback for PrintCallback {
 struct Entry {
     code: Code,
     count: uint,
-    next: Option<~Entry>,
+    next: Option<Box<Entry>>,
 }
 
 struct Table {
     count: uint,
-    items: Vec<Option<~Entry>> }
+    items: Vec<Option<Box<Entry>>> }
 
 struct Items<'a> {
     cur: Option<&'a Entry>,
-    items: slice::Items<'a, Option<~Entry>>,
+    items: slice::Items<'a, Option<Box<Entry>>>,
 }
 
 impl Table {
@@ -114,7 +114,7 @@ impl Table {
     fn search_remainder<C:TableCallback>(item: &mut Entry, key: Code, c: C) {
         match item.next {
             None => {
-                let mut entry = ~Entry {
+                let mut entry = box Entry {
                     code: key,
                     count: 0,
                     next: None,
@@ -138,7 +138,7 @@ impl Table {
 
         {
             if self.items.get(index as uint).is_none() {
-                let mut entry = ~Entry {
+                let mut entry = box Entry {
                     code: key,
                     count: 0,
                     next: None,
diff --git a/src/test/bench/shootout-regex-dna.rs b/src/test/bench/shootout-regex-dna.rs
index 0f86b8043a0..f5409688bc6 100644
--- a/src/test/bench/shootout-regex-dna.rs
+++ b/src/test/bench/shootout-regex-dna.rs
@@ -34,9 +34,9 @@ fn count_matches(seq: &str, variant: &Regex) -> int {
 fn main() {
     let mut rdr = if std::os::getenv("RUST_BENCH").is_some() {
         let fd = io::File::open(&Path::new("shootout-k-nucleotide.data"));
-        ~io::BufferedReader::new(fd) as ~io::Reader
+        box io::BufferedReader::new(fd) as Box<io::Reader>
     } else {
-        ~io::stdin() as ~io::Reader
+        box io::stdin() as Box<io::Reader>
     };
     let mut seq = StrBuf::from_str(rdr.read_to_str().unwrap());
     let ilen = seq.len();
diff --git a/src/test/bench/sudoku.rs b/src/test/bench/sudoku.rs
index 3398cd84acd..bd47734c3da 100644
--- a/src/test/bench/sudoku.rs
+++ b/src/test/bench/sudoku.rs
@@ -15,8 +15,8 @@
 use std::io;
 use std::io::stdio::StdReader;
 use std::io::BufferedReader;
-use std::os;
 use std::num::Bitwise;
+use std::os;
 
 // Computes a single solution to a given 9x9 sudoku
 //
@@ -132,7 +132,7 @@ impl Sudoku {
     fn next_color(&mut self, row: u8, col: u8, start_color: u8) -> bool {
         if start_color < 10u8 {
             // colors not yet used
-            let mut avail = ~Colors::new(start_color);
+            let mut avail = box Colors::new(start_color);
 
             // drop colors already in use in neighbourhood
             self.drop_colors(avail, row, col);
diff --git a/src/test/bench/task-perf-alloc-unwind.rs b/src/test/bench/task-perf-alloc-unwind.rs
index 813a75cfb4d..fc47269ef87 100644
--- a/src/test/bench/task-perf-alloc-unwind.rs
+++ b/src/test/bench/task-perf-alloc-unwind.rs
@@ -24,7 +24,7 @@ enum List<T> {
 }
 
 enum UniqueList {
-    ULNil, ULCons(~UniqueList)
+    ULNil, ULCons(Box<UniqueList>)
 }
 
 fn main() {
@@ -53,8 +53,8 @@ type nillist = List<()>;
 
 struct State {
     managed: @nillist,
-    unique: ~nillist,
-    tuple: (@nillist, ~nillist),
+    unique: Box<nillist>,
+    tuple: (@nillist, Box<nillist>),
     vec: Vec<@nillist>,
     res: r
 }
@@ -85,8 +85,8 @@ fn recurse_or_fail(depth: int, st: Option<State>) {
           None => {
             State {
                 managed: @Nil,
-                unique: ~Nil,
-                tuple: (@Nil, ~Nil),
+                unique: box Nil,
+                tuple: (@Nil, box Nil),
                 vec: vec!(@Nil),
                 res: r(@Nil)
             }
@@ -94,9 +94,9 @@ fn recurse_or_fail(depth: int, st: Option<State>) {
           Some(st) => {
             State {
                 managed: @Cons((), st.managed),
-                unique: ~Cons((), @*st.unique),
+                unique: box Cons((), @*st.unique),
                 tuple: (@Cons((), st.tuple.ref0().clone()),
-                        ~Cons((), @*st.tuple.ref1().clone())),
+                        box Cons((), @*st.tuple.ref1().clone())),
                 vec: st.vec.clone().append(&[@Cons((), *st.vec.last().unwrap())]),
                 res: r(@Cons((), st.res._l))
             }