about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorAaron Turon <aturon@mozilla.com>2014-10-02 11:48:07 -0700
committerAaron Turon <aturon@mozilla.com>2014-10-02 11:48:07 -0700
commitd2ea0315e09cbd495a67c9e3d5053b57e2b5a8b7 (patch)
treed39de6be5866c0f0f37f9f3219b8217c873d8b52 /src/test
parentc0c6c895890770d7029324fd9b592f42e0564e8b (diff)
downloadrust-d2ea0315e09cbd495a67c9e3d5053b57e2b5a8b7.tar.gz
rust-d2ea0315e09cbd495a67c9e3d5053b57e2b5a8b7.zip
Revert "Use slice syntax instead of slice_to, etc."
This reverts commit 40b9f5ded50ac4ce8c9323921ec556ad611af6b7.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/bench/shootout-fannkuch-redux.rs6
-rw-r--r--src/test/bench/shootout-fasta-redux.rs6
-rw-r--r--src/test/bench/shootout-fasta.rs2
-rw-r--r--src/test/bench/shootout-k-nucleotide-pipes.rs4
-rw-r--r--src/test/bench/shootout-k-nucleotide.rs4
-rw-r--r--src/test/bench/shootout-reverse-complement.rs2
-rw-r--r--src/test/compile-fail/issue-15730.rs2
-rw-r--r--src/test/debuginfo/vec-slices.rs2
-rw-r--r--src/test/run-pass/issue-3888-2.rs2
-rw-r--r--src/test/run-pass/issue-4464.rs2
-rw-r--r--src/test/run-pass/issue-8898.rs2
11 files changed, 17 insertions, 17 deletions
diff --git a/src/test/bench/shootout-fannkuch-redux.rs b/src/test/bench/shootout-fannkuch-redux.rs
index 1260cc33725..5e812e500d6 100644
--- a/src/test/bench/shootout-fannkuch-redux.rs
+++ b/src/test/bench/shootout-fannkuch-redux.rs
@@ -50,7 +50,7 @@ fn rotate(x: &mut [i32]) {
 
 fn next_permutation(perm: &mut [i32], count: &mut [i32]) {
     for i in range(1, perm.len()) {
-        rotate(perm[mut ..i + 1]);
+        rotate(perm.slice_to_mut(i + 1));
         let count_i = &mut count[i];
         if *count_i >= i as i32 {
             *count_i = 0;
@@ -99,7 +99,7 @@ impl Perm {
             let d = idx / self.fact[i] as i32;
             self.cnt[i] = d;
             idx %= self.fact[i] as i32;
-            for (place, val) in pp.iter_mut().zip(self.perm.p[..i+1].iter()) {
+            for (place, val) in pp.iter_mut().zip(self.perm.p.slice_to(i + 1).iter()) {
                 *place = (*val) as u8
             }
 
@@ -125,7 +125,7 @@ impl Perm {
 
 
 fn reverse(tperm: &mut [i32], mut k: uint) {
-    tperm[mut ..k].reverse()
+    tperm.slice_to_mut(k).reverse()
 }
 
 fn work(mut perm: Perm, n: uint, max: uint) -> (i32, i32) {
diff --git a/src/test/bench/shootout-fasta-redux.rs b/src/test/bench/shootout-fasta-redux.rs
index 3f8c929aecf..b68404bdd72 100644
--- a/src/test/bench/shootout-fasta-redux.rs
+++ b/src/test/bench/shootout-fasta-redux.rs
@@ -124,8 +124,8 @@ impl<'a, W: Writer> RepeatFasta<'a, W> {
 
         copy_memory(buf.as_mut_slice(), alu);
         let buf_len = buf.len();
-        copy_memory(buf[mut alu_len..buf_len],
-                    alu[..LINE_LEN]);
+        copy_memory(buf.slice_mut(alu_len, buf_len),
+                    alu.slice_to(LINE_LEN));
 
         let mut pos = 0;
         let mut bytes;
@@ -201,7 +201,7 @@ impl<'a, W: Writer> RandomFasta<'a, W> {
         for i in range(0u, chars_left) {
             buf[i] = self.nextc();
         }
-        self.out.write(buf[..chars_left])
+        self.out.write(buf.slice_to(chars_left))
     }
 }
 
diff --git a/src/test/bench/shootout-fasta.rs b/src/test/bench/shootout-fasta.rs
index ed8ddcaa0ed..e5ddcac1e8f 100644
--- a/src/test/bench/shootout-fasta.rs
+++ b/src/test/bench/shootout-fasta.rs
@@ -93,7 +93,7 @@ fn make_fasta<W: Writer, I: Iterator<u8>>(
         }
         n -= nb;
         line[nb] = '\n' as u8;
-        wr.write(line[..nb+1]);
+        wr.write(line.slice_to(nb + 1));
     }
 }
 
diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs
index 80d623bbeb1..f4d1cee5fb4 100644
--- a/src/test/bench/shootout-k-nucleotide-pipes.rs
+++ b/src/test/bench/shootout-k-nucleotide-pipes.rs
@@ -97,11 +97,11 @@ fn windows_with_carry(bb: &[u8], nn: uint, it: |window: &[u8]|) -> Vec<u8> {
 
    let len = bb.len();
    while ii < len - (nn - 1u) {
-      it(bb[ii..ii+nn]);
+      it(bb.slice(ii, ii+nn));
       ii += 1u;
    }
 
-   return Vec::from_slice(bb[len - (nn - 1u)..len]);
+   return Vec::from_slice(bb.slice(len - (nn - 1u), len));
 }
 
 fn make_sequence_processor(sz: uint,
diff --git a/src/test/bench/shootout-k-nucleotide.rs b/src/test/bench/shootout-k-nucleotide.rs
index 70fd937d2a3..cecc95354af 100644
--- a/src/test/bench/shootout-k-nucleotide.rs
+++ b/src/test/bench/shootout-k-nucleotide.rs
@@ -240,14 +240,14 @@ fn generate_frequencies(mut input: &[u8], frame: uint) -> Table {
     // Pull first frame.
     for _ in range(0, frame) {
         code = code.push_char(input[0]);
-        input = input[1..];
+        input = input.slice_from(1);
     }
     frequencies.lookup(code, BumpCallback);
 
     while input.len() != 0 && input[0] != ('>' as u8) {
         code = code.rotate(input[0], frame);
         frequencies.lookup(code, BumpCallback);
-        input = input[1..];
+        input = input.slice_from(1);
     }
     frequencies
 }
diff --git a/src/test/bench/shootout-reverse-complement.rs b/src/test/bench/shootout-reverse-complement.rs
index e5f22a3d07c..e522bcaf4db 100644
--- a/src/test/bench/shootout-reverse-complement.rs
+++ b/src/test/bench/shootout-reverse-complement.rs
@@ -81,7 +81,7 @@ fn main() {
             Some(c) => c
         };
         let len = seq.len();
-        let seq = seq[mut begin+1..len-1];
+        let seq = seq.slice_mut(begin + 1, len - 1);
 
         // arrange line breaks
         let len = seq.len();
diff --git a/src/test/compile-fail/issue-15730.rs b/src/test/compile-fail/issue-15730.rs
index fc8c4e36075..6cddd8ee939 100644
--- a/src/test/compile-fail/issue-15730.rs
+++ b/src/test/compile-fail/issue-15730.rs
@@ -11,5 +11,5 @@
 fn main() {
     let mut array = [1, 2, 3];
 //~^ ERROR cannot determine a type for this local variable: cannot determine the type of this integ
-    let pie_slice = array[1..2];
+    let pie_slice = array.slice(1, 2);
 }
diff --git a/src/test/debuginfo/vec-slices.rs b/src/test/debuginfo/vec-slices.rs
index 392a025b1f0..ba8c4d249ce 100644
--- a/src/test/debuginfo/vec-slices.rs
+++ b/src/test/debuginfo/vec-slices.rs
@@ -94,7 +94,7 @@ fn main() {
     let empty: &[i64] = &[];
     let singleton: &[i64] = &[1];
     let multiple: &[i64] = &[2, 3, 4, 5];
-    let slice_of_slice = multiple[1..3];
+    let slice_of_slice = multiple.slice(1,3);
 
     let padded_tuple: &[(i32, i16)] = &[(6, 7), (8, 9)];
 
diff --git a/src/test/run-pass/issue-3888-2.rs b/src/test/run-pass/issue-3888-2.rs
index 20629673619..c9f6733fa25 100644
--- a/src/test/run-pass/issue-3888-2.rs
+++ b/src/test/run-pass/issue-3888-2.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 fn vec_peek<'r, T>(v: &'r [T]) -> &'r [T] {
-    v[1..5]
+    v.slice(1, 5)
 }
 
 pub fn main() {}
diff --git a/src/test/run-pass/issue-4464.rs b/src/test/run-pass/issue-4464.rs
index 0f3f9149536..822fda8a18e 100644
--- a/src/test/run-pass/issue-4464.rs
+++ b/src/test/run-pass/issue-4464.rs
@@ -8,6 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn broken(v: &[u8], i: uint, j: uint) -> &[u8] { v[i..j] }
+fn broken(v: &[u8], i: uint, j: uint) -> &[u8] { v.slice(i, j) }
 
 pub fn main() {}
diff --git a/src/test/run-pass/issue-8898.rs b/src/test/run-pass/issue-8898.rs
index 1838f34a9ab..dea352833f0 100644
--- a/src/test/run-pass/issue-8898.rs
+++ b/src/test/run-pass/issue-8898.rs
@@ -21,7 +21,7 @@ pub fn main() {
     let abc = [1i, 2, 3];
     let tf = [true, false];
     let x  = [(), ()];
-    let slice = x[0..1];
+    let slice = x.slice(0,1);
     let z = box(GC) x;
 
     assert_repr_eq(abc, "[1, 2, 3]".to_string());