about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libarena/lib.rs2
-rw-r--r--src/libcollections/slice.rs12
-rw-r--r--src/libcoretest/any.rs24
-rw-r--r--src/libcoretest/option.rs3
-rw-r--r--src/libcoretest/result.rs1
-rw-r--r--src/libdebug/repr.rs1
-rw-r--r--src/libgraphviz/lib.rs6
-rw-r--r--src/libgreen/sched.rs1
-rw-r--r--src/libnum/bigint.rs84
-rw-r--r--src/librbml/lib.rs3
-rw-r--r--src/librlibc/lib.rs2
-rw-r--r--src/librustrt/c_str.rs2
-rw-r--r--src/librustrt/task.rs2
-rw-r--r--src/libsync/spsc_queue.rs2
-rw-r--r--src/libuuid/lib.rs4
15 files changed, 79 insertions, 70 deletions
diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs
index e9189854853..ee3fd6ad0eb 100644
--- a/src/libarena/lib.rs
+++ b/src/libarena/lib.rs
@@ -509,6 +509,7 @@ mod tests {
     use self::test::Bencher;
     use super::{Arena, TypedArena};
 
+    #[allow(dead_code)]
     struct Point {
         x: int,
         y: int,
@@ -564,6 +565,7 @@ mod tests {
         })
     }
 
+    #[allow(dead_code)]
     struct Noncopy {
         string: String,
         array: Vec<int>,
diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs
index 2418fabfff1..36edd913de2 100644
--- a/src/libcollections/slice.rs
+++ b/src/libcollections/slice.rs
@@ -864,6 +864,7 @@ mod tests {
     }
 
     #[test]
+    #[allow(deprecated)]
     fn test_tailn() {
         let mut a = vec![11i, 12, 13];
         let b: &[int] = &[11, 12, 13];
@@ -875,6 +876,7 @@ mod tests {
 
     #[test]
     #[should_fail]
+    #[allow(deprecated)]
     fn test_tailn_empty() {
         let a: Vec<int> = vec![];
         a.tailn(2);
@@ -909,6 +911,7 @@ mod tests {
 
     #[test]
     #[should_fail]
+    #[allow(deprecated)]
     fn test_initn_empty() {
         let a: Vec<int> = vec![];
         a.as_slice().initn(2);
@@ -1466,6 +1469,7 @@ mod tests {
     }
 
     #[test]
+    #[allow(deprecated)]
     fn test_unshift() {
         let mut x = vec![1i, 2, 3];
         x.unshift(0);
@@ -2079,6 +2083,7 @@ mod tests {
     }
 
     #[test]
+    #[allow(deprecated)]
     fn test_shift_ref() {
         let mut x: &[int] = [1, 2, 3, 4, 5];
         let h = x.shift_ref();
@@ -2092,6 +2097,7 @@ mod tests {
     }
 
     #[test]
+    #[allow(deprecated)]
     fn test_pop_ref() {
         let mut x: &[int] = [1, 2, 3, 4, 5];
         let h = x.pop_ref();
@@ -2171,6 +2177,7 @@ mod tests {
     }
 
     #[test]
+    #[allow(deprecated)]
     fn test_mut_shift_ref() {
         let mut x: &mut [int] = [1, 2, 3, 4, 5];
         let h = x.mut_shift_ref();
@@ -2184,6 +2191,7 @@ mod tests {
     }
 
     #[test]
+    #[allow(deprecated)]
     fn test_mut_pop_ref() {
         let mut x: &mut [int] = [1, 2, 3, 4, 5];
         let h = x.mut_pop_ref();
@@ -2441,7 +2449,7 @@ mod bench {
         b.iter(|| {
             v.sort();
         });
-        b.bytes = (v.len() * mem::size_of_val(v.get(0))) as u64;
+        b.bytes = (v.len() * mem::size_of_val(&v[0])) as u64;
     }
 
     type BigSortable = (u64,u64,u64,u64);
@@ -2485,6 +2493,6 @@ mod bench {
         b.iter(|| {
             v.sort();
         });
-        b.bytes = (v.len() * mem::size_of_val(v.get(0))) as u64;
+        b.bytes = (v.len() * mem::size_of_val(&v[0])) as u64;
     }
 }
diff --git a/src/libcoretest/any.rs b/src/libcoretest/any.rs
index fae4a26cd38..9656a6caba0 100644
--- a/src/libcoretest/any.rs
+++ b/src/libcoretest/any.rs
@@ -51,22 +51,22 @@ fn any_owning() {
 }
 
 #[test]
-fn any_as_ref() {
+fn any_downcast_ref() {
     let a = &5u as &Any;
 
-    match a.as_ref::<uint>() {
+    match a.downcast_ref::<uint>() {
         Some(&5) => {}
         x => fail!("Unexpected value {}", x)
     }
 
-    match a.as_ref::<Test>() {
+    match a.downcast_ref::<Test>() {
         None => {}
         x => fail!("Unexpected value {}", x)
     }
 }
 
 #[test]
-fn any_as_mut() {
+fn any_downcast_mut() {
     let mut a = 5u;
     let mut b = box 7u;
 
@@ -74,7 +74,7 @@ fn any_as_mut() {
     let tmp: &mut uint = &mut *b;
     let b_r = tmp as &mut Any;
 
-    match a_r.as_mut::<uint>() {
+    match a_r.downcast_mut::<uint>() {
         Some(x) => {
             assert_eq!(*x, 5u);
             *x = 612;
@@ -82,7 +82,7 @@ fn any_as_mut() {
         x => fail!("Unexpected value {}", x)
     }
 
-    match b_r.as_mut::<uint>() {
+    match b_r.downcast_mut::<uint>() {
         Some(x) => {
             assert_eq!(*x, 7u);
             *x = 413;
@@ -90,22 +90,22 @@ fn any_as_mut() {
         x => fail!("Unexpected value {}", x)
     }
 
-    match a_r.as_mut::<Test>() {
+    match a_r.downcast_mut::<Test>() {
         None => (),
         x => fail!("Unexpected value {}", x)
     }
 
-    match b_r.as_mut::<Test>() {
+    match b_r.downcast_mut::<Test>() {
         None => (),
         x => fail!("Unexpected value {}", x)
     }
 
-    match a_r.as_mut::<uint>() {
+    match a_r.downcast_mut::<uint>() {
         Some(&612) => {}
         x => fail!("Unexpected value {}", x)
     }
 
-    match b_r.as_mut::<uint>() {
+    match b_r.downcast_mut::<uint>() {
         Some(&413) => {}
         x => fail!("Unexpected value {}", x)
     }
@@ -121,11 +121,11 @@ fn any_fixed_vec() {
 
 
 #[bench]
-fn bench_as_ref(b: &mut Bencher) {
+fn bench_downcast_ref(b: &mut Bencher) {
     b.iter(|| {
         let mut x = 0i;
         let mut y = &mut x as &mut Any;
         test::black_box(&mut y);
-        test::black_box(y.as_ref::<int>() == Some(&0));
+        test::black_box(y.downcast_ref::<int>() == Some(&0));
     });
 }
diff --git a/src/libcoretest/option.rs b/src/libcoretest/option.rs
index 2dad9fc3a22..6e5bf6e8f2d 100644
--- a/src/libcoretest/option.rs
+++ b/src/libcoretest/option.rs
@@ -131,6 +131,7 @@ fn test_or_else() {
 }
 
 #[test]
+#[allow(deprecated)]
 fn test_option_while_some() {
     let mut i = 0i;
     Some(10i).while_some(|j| {
@@ -184,6 +185,7 @@ fn test_unwrap_or_else() {
 }
 
 #[test]
+#[allow(deprecated)]
 fn test_filtered() {
     let some_stuff = Some(42i);
     let modified_stuff = some_stuff.filtered(|&x| {x < 10});
@@ -256,6 +258,7 @@ fn test_mutate() {
 }
 
 #[test]
+#[allow(deprecated)]
 fn test_collect() {
     let v: Option<Vec<int>> = collect(range(0i, 0)
                                       .map(|_| Some(0i)));
diff --git a/src/libcoretest/result.rs b/src/libcoretest/result.rs
index 7c7e0a542cd..dbc393967d3 100644
--- a/src/libcoretest/result.rs
+++ b/src/libcoretest/result.rs
@@ -69,6 +69,7 @@ pub fn test_impl_map_err() {
 }
 
 #[test]
+#[allow(deprecated)]
 fn test_collect() {
     let v: Result<Vec<int>, ()> = collect(range(0i, 0).map(|_| Ok::<int, ()>(0)));
     assert!(v == Ok(vec![]));
diff --git a/src/libdebug/repr.rs b/src/libdebug/repr.rs
index 1f66d0352da..7fe6f2dbf67 100644
--- a/src/libdebug/repr.rs
+++ b/src/libdebug/repr.rs
@@ -568,6 +568,7 @@ pub fn repr_to_string<T>(t: &T) -> String {
 }
 
 #[cfg(test)]
+#[allow(dead_code)]
 struct P {a: int, b: f64}
 
 #[test]
diff --git a/src/libgraphviz/lib.rs b/src/libgraphviz/lib.rs
index d8325e05cdf..ea298f5e05f 100644
--- a/src/libgraphviz/lib.rs
+++ b/src/libgraphviz/lib.rs
@@ -632,9 +632,9 @@ mod tests {
             id_name(n)
         }
         fn node_label(&'a self, n: &Node) -> LabelText<'a> {
-            match self.node_labels.get(*n) {
-                &Some(ref l) => LabelStr(str::Slice(l.as_slice())),
-                &None        => LabelStr(id_name(n).name()),
+            match self.node_labels[*n] {
+                Some(ref l) => LabelStr(str::Slice(l.as_slice())),
+                None        => LabelStr(id_name(n).name()),
             }
         }
         fn edge_label(&'a self, e: & &'a Edge) -> LabelText<'a> {
diff --git a/src/libgreen/sched.rs b/src/libgreen/sched.rs
index 084a66fdddf..1075466d099 100644
--- a/src/libgreen/sched.rs
+++ b/src/libgreen/sched.rs
@@ -1414,6 +1414,7 @@ mod test {
         // Regression test that the `start` task entrypoint can
         // contain dtors that use task resources
         run(proc() {
+            #[allow(dead_code)]
             struct S { field: () }
 
             impl Drop for S {
diff --git a/src/libnum/bigint.rs b/src/libnum/bigint.rs
index 39e21cfc486..c97f9513fc3 100644
--- a/src/libnum/bigint.rs
+++ b/src/libnum/bigint.rs
@@ -1978,10 +1978,10 @@ mod biguint_tests {
     #[test]
     fn test_checked_add() {
         for elm in sum_triples.iter() {
-            let (aVec, bVec, cVec) = *elm;
-            let a = BigUint::from_slice(aVec);
-            let b = BigUint::from_slice(bVec);
-            let c = BigUint::from_slice(cVec);
+            let (a_vec, b_vec, c_vec) = *elm;
+            let a = BigUint::from_slice(a_vec);
+            let b = BigUint::from_slice(b_vec);
+            let c = BigUint::from_slice(c_vec);
 
             assert!(a.checked_add(&b).unwrap() == c);
             assert!(b.checked_add(&a).unwrap() == c);
@@ -1991,10 +1991,10 @@ mod biguint_tests {
     #[test]
     fn test_checked_sub() {
         for elm in sum_triples.iter() {
-            let (aVec, bVec, cVec) = *elm;
-            let a = BigUint::from_slice(aVec);
-            let b = BigUint::from_slice(bVec);
-            let c = BigUint::from_slice(cVec);
+            let (a_vec, b_vec, c_vec) = *elm;
+            let a = BigUint::from_slice(a_vec);
+            let b = BigUint::from_slice(b_vec);
+            let c = BigUint::from_slice(c_vec);
 
             assert!(c.checked_sub(&a).unwrap() == b);
             assert!(c.checked_sub(&b).unwrap() == a);
@@ -2011,21 +2011,21 @@ mod biguint_tests {
     #[test]
     fn test_checked_mul() {
         for elm in mul_triples.iter() {
-            let (aVec, bVec, cVec) = *elm;
-            let a = BigUint::from_slice(aVec);
-            let b = BigUint::from_slice(bVec);
-            let c = BigUint::from_slice(cVec);
+            let (a_vec, b_vec, c_vec) = *elm;
+            let a = BigUint::from_slice(a_vec);
+            let b = BigUint::from_slice(b_vec);
+            let c = BigUint::from_slice(c_vec);
 
             assert!(a.checked_mul(&b).unwrap() == c);
             assert!(b.checked_mul(&a).unwrap() == c);
         }
 
         for elm in div_rem_quadruples.iter() {
-            let (aVec, bVec, cVec, dVec) = *elm;
-            let a = BigUint::from_slice(aVec);
-            let b = BigUint::from_slice(bVec);
-            let c = BigUint::from_slice(cVec);
-            let d = BigUint::from_slice(dVec);
+            let (a_vec, b_vec, c_vec, d_vec) = *elm;
+            let a = BigUint::from_slice(a_vec);
+            let b = BigUint::from_slice(b_vec);
+            let c = BigUint::from_slice(c_vec);
+            let d = BigUint::from_slice(d_vec);
 
             assert!(a == b.checked_mul(&c).unwrap() + d);
             assert!(a == c.checked_mul(&b).unwrap() + d);
@@ -2035,10 +2035,10 @@ mod biguint_tests {
     #[test]
     fn test_checked_div() {
         for elm in mul_triples.iter() {
-            let (aVec, bVec, cVec) = *elm;
-            let a = BigUint::from_slice(aVec);
-            let b = BigUint::from_slice(bVec);
-            let c = BigUint::from_slice(cVec);
+            let (a_vec, b_vec, c_vec) = *elm;
+            let a = BigUint::from_slice(a_vec);
+            let b = BigUint::from_slice(b_vec);
+            let c = BigUint::from_slice(c_vec);
 
             if !a.is_zero() {
                 assert!(c.checked_div(&a).unwrap() == b);
@@ -2651,10 +2651,10 @@ mod bigint_tests {
     #[test]
     fn test_checked_add() {
         for elm in sum_triples.iter() {
-            let (aVec, bVec, cVec) = *elm;
-            let a = BigInt::from_slice(Plus, aVec);
-            let b = BigInt::from_slice(Plus, bVec);
-            let c = BigInt::from_slice(Plus, cVec);
+            let (a_vec, b_vec, c_vec) = *elm;
+            let a = BigInt::from_slice(Plus, a_vec);
+            let b = BigInt::from_slice(Plus, b_vec);
+            let c = BigInt::from_slice(Plus, c_vec);
 
             assert!(a.checked_add(&b).unwrap() == c);
             assert!(b.checked_add(&a).unwrap() == c);
@@ -2670,10 +2670,10 @@ mod bigint_tests {
     #[test]
     fn test_checked_sub() {
         for elm in sum_triples.iter() {
-            let (aVec, bVec, cVec) = *elm;
-            let a = BigInt::from_slice(Plus, aVec);
-            let b = BigInt::from_slice(Plus, bVec);
-            let c = BigInt::from_slice(Plus, cVec);
+            let (a_vec, b_vec, c_vec) = *elm;
+            let a = BigInt::from_slice(Plus, a_vec);
+            let b = BigInt::from_slice(Plus, b_vec);
+            let c = BigInt::from_slice(Plus, c_vec);
 
             assert!(c.checked_sub(&a).unwrap() == b);
             assert!(c.checked_sub(&b).unwrap() == a);
@@ -2689,10 +2689,10 @@ mod bigint_tests {
     #[test]
     fn test_checked_mul() {
         for elm in mul_triples.iter() {
-            let (aVec, bVec, cVec) = *elm;
-            let a = BigInt::from_slice(Plus, aVec);
-            let b = BigInt::from_slice(Plus, bVec);
-            let c = BigInt::from_slice(Plus, cVec);
+            let (a_vec, b_vec, c_vec) = *elm;
+            let a = BigInt::from_slice(Plus, a_vec);
+            let b = BigInt::from_slice(Plus, b_vec);
+            let c = BigInt::from_slice(Plus, c_vec);
 
             assert!(a.checked_mul(&b).unwrap() == c);
             assert!(b.checked_mul(&a).unwrap() == c);
@@ -2702,11 +2702,11 @@ mod bigint_tests {
         }
 
         for elm in div_rem_quadruples.iter() {
-            let (aVec, bVec, cVec, dVec) = *elm;
-            let a = BigInt::from_slice(Plus, aVec);
-            let b = BigInt::from_slice(Plus, bVec);
-            let c = BigInt::from_slice(Plus, cVec);
-            let d = BigInt::from_slice(Plus, dVec);
+            let (a_vec, b_vec, c_vec, d_vec) = *elm;
+            let a = BigInt::from_slice(Plus, a_vec);
+            let b = BigInt::from_slice(Plus, b_vec);
+            let c = BigInt::from_slice(Plus, c_vec);
+            let d = BigInt::from_slice(Plus, d_vec);
 
             assert!(a == b.checked_mul(&c).unwrap() + d);
             assert!(a == c.checked_mul(&b).unwrap() + d);
@@ -2715,10 +2715,10 @@ mod bigint_tests {
     #[test]
     fn test_checked_div() {
         for elm in mul_triples.iter() {
-            let (aVec, bVec, cVec) = *elm;
-            let a = BigInt::from_slice(Plus, aVec);
-            let b = BigInt::from_slice(Plus, bVec);
-            let c = BigInt::from_slice(Plus, cVec);
+            let (a_vec, b_vec, c_vec) = *elm;
+            let a = BigInt::from_slice(Plus, a_vec);
+            let b = BigInt::from_slice(Plus, b_vec);
+            let c = BigInt::from_slice(Plus, c_vec);
 
             if !a.is_zero() {
                 assert!(c.checked_div(&a).unwrap() == b);
diff --git a/src/librbml/lib.rs b/src/librbml/lib.rs
index 933f2b223e9..6171a9946b6 100644
--- a/src/librbml/lib.rs
+++ b/src/librbml/lib.rs
@@ -1047,10 +1047,7 @@ mod tests {
 
     use serialize::{Encodable, Decodable};
 
-    use std::io::{IoError, IoResult, SeekStyle};
-    use std::io;
     use std::option::{None, Option, Some};
-    use std::slice;
 
     #[test]
     fn test_vuint_at() {
diff --git a/src/librlibc/lib.rs b/src/librlibc/lib.rs
index d51d5a0aef2..2ab7a6c52fa 100644
--- a/src/librlibc/lib.rs
+++ b/src/librlibc/lib.rs
@@ -108,8 +108,6 @@ pub unsafe extern "C" fn memcmp(s1: *const u8, s2: *const u8, n: uint) -> i32 {
 
 #[cfg(test)]
 mod test {
-    use core::option::{Some, None};
-    use core::iter::Iterator;
     use core::collections::Collection;
     use core::str::StrSlice;
     use core::slice::{MutableSlice, ImmutableSlice};
diff --git a/src/librustrt/c_str.rs b/src/librustrt/c_str.rs
index 000def0cc3b..5e0004f2a2a 100644
--- a/src/librustrt/c_str.rs
+++ b/src/librustrt/c_str.rs
@@ -671,7 +671,7 @@ mod tests {
     #[test]
     #[should_fail]
     fn test_new_fail() {
-        let c_str = unsafe { CString::new(ptr::null(), false) };
+        let _c_str = unsafe { CString::new(ptr::null(), false) };
     }
 
     #[test]
diff --git a/src/librustrt/task.rs b/src/librustrt/task.rs
index 9d921943313..3d42b91fef1 100644
--- a/src/librustrt/task.rs
+++ b/src/librustrt/task.rs
@@ -662,7 +662,7 @@ mod test {
     #[test]
     fn block_and_wake() {
         let task = box Task::new();
-        let mut task = BlockedTask::block(task).wake().unwrap();
+        let task = BlockedTask::block(task).wake().unwrap();
         task.drop();
     }
 }
diff --git a/src/libsync/spsc_queue.rs b/src/libsync/spsc_queue.rs
index 32b77be78a4..cb4d33049d8 100644
--- a/src/libsync/spsc_queue.rs
+++ b/src/libsync/spsc_queue.rs
@@ -298,7 +298,7 @@ mod test {
 
     use native;
 
-    use super::{queue, Queue};
+    use super::{queue};
 
     #[test]
     fn smoke() {
diff --git a/src/libuuid/lib.rs b/src/libuuid/lib.rs
index 98dd129f3d2..09dc8166908 100644
--- a/src/libuuid/lib.rs
+++ b/src/libuuid/lib.rs
@@ -527,7 +527,6 @@ mod uuidtest {
     use super::{Uuid, VariantMicrosoft, VariantNCS, VariantRFC4122,
                 Version1Mac, Version2Dce, Version3Md5, Version4Random,
                 Version5Sha1};
-    use std::io::MemWriter;
     use std::rand;
 
     #[test]
@@ -798,7 +797,6 @@ mod uuidtest {
     #[test]
     fn test_serialize_round_trip() {
         use serialize::json;
-        use serialize::{Encodable, Decodable};
 
         let u = Uuid::new_v4();
         let s = json::encode(&u);
@@ -809,7 +807,7 @@ mod uuidtest {
     #[test]
     fn test_bad_decode() {
         use serialize::json;
-        use serialize::{Encodable, Decodable};
+        use serialize::{Decodable};
 
         let js_good = json::String("a1a2a3a4a5a6a7a8a1a2a3a4a5a6a7a8".to_string());
         let js_bad1 = json::String("a1a2a3a4a5a6a7a8a1a2a3a4a5a6a7ah".to_string());