]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/pure-sum.rs
test: Make manual changes to deal with the fallout from removal of
[rust.git] / src / test / run-pass / pure-sum.rs
index d5f1caaf74da1570b70580abb0d1a8d3067ad241..cd5ce150bcb0d5412207f29107417be09f7c971d 100644 (file)
 
 // Check that functions can modify local state.
 
+use std::vec_ng::Vec;
+
 fn sums_to(v: Vec<int> , sum: int) -> bool {
     let mut i = 0u;
     let mut sum0 = 0;
     while i < v.len() {
-        sum0 += v[i];
+        sum0 += *v.get(i);
         i += 1u;
     }
     return sum0 == sum;
@@ -24,7 +26,7 @@ fn sums_to_using_uniq(v: Vec<int> , sum: int) -> bool {
     let mut i = 0u;
     let mut sum0 = ~0;
     while i < v.len() {
-        *sum0 += v[i];
+        *sum0 += *v.get(i);
         i += 1u;
     }
     return *sum0 == sum;
@@ -34,7 +36,7 @@ fn sums_to_using_rec(v: Vec<int> , sum: int) -> bool {
     let mut i = 0u;
     let mut sum0 = F {f: 0};
     while i < v.len() {
-        sum0.f += v[i];
+        sum0.f += *v.get(i);
         i += 1u;
     }
     return sum0.f == sum;
@@ -46,7 +48,7 @@ fn sums_to_using_uniq_rec(v: Vec<int> , sum: int) -> bool {
     let mut i = 0u;
     let mut sum0 = F {f: ~0};
     while i < v.len() {
-        *sum0.f += v[i];
+        *sum0.f += *v.get(i);
         i += 1u;
     }
     return *sum0.f == sum;