summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorAlexis <a.beingessner@gmail.com>2015-02-19 12:57:25 -0500
committerAlexis <a.beingessner@gmail.com>2015-02-20 19:55:00 -0500
commit97aa34046ffec7be1e3e4f383f205344ed67da6d (patch)
treef61920dd16a5230660e02e053afe91513f118ee8 /src/libstd
parent522d09dfecbeca1595f25ac58c6d0178bbd21d7d (diff)
downloadrust-97aa34046ffec7be1e3e4f383f205344ed67da6d.tar.gz
rust-97aa34046ffec7be1e3e4f383f205344ed67da6d.zip
try to reduce bajillion warnings
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/collections/hash/map.rs2
-rw-r--r--src/libstd/fs.rs6
-rw-r--r--src/libstd/io/buffered.rs7
-rw-r--r--src/libstd/io/mod.rs8
-rw-r--r--src/libstd/lib.rs3
-rw-r--r--src/libstd/net/tcp.rs6
-rw-r--r--src/libstd/net/test.rs2
-rw-r--r--src/libstd/old_io/mod.rs2
-rw-r--r--src/libstd/old_path/mod.rs2
-rwxr-xr-xsrc/libstd/path.rs1
-rw-r--r--src/libstd/process.rs8
-rw-r--r--src/libstd/thread.rs4
12 files changed, 22 insertions, 29 deletions
diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs
index ade4f1f0533..f5d2b8aed29 100644
--- a/src/libstd/collections/hash/map.rs
+++ b/src/libstd/collections/hash/map.rs
@@ -88,7 +88,6 @@ impl DefaultResizePolicy {
 
 #[test]
 fn test_resize_policy() {
-    use prelude::v1::*;
     let rp = DefaultResizePolicy;
     for n in 0..1000 {
         assert!(rp.min_capacity(rp.usable_capacity(n)) <= n);
@@ -2256,6 +2255,7 @@ mod test_map {
 
     #[test]
     fn test_entry_take_doesnt_corrupt() {
+        #![allow(deprecated)] //rand
         // Test for #19292
         fn check(m: &HashMap<isize, ()>) {
             for k in m.keys() {
diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs
index 69791084e2f..98c1b50a9bf 100644
--- a/src/libstd/fs.rs
+++ b/src/libstd/fs.rs
@@ -744,6 +744,8 @@ pub fn set_permissions<P: AsPath + ?Sized>(path: &P, perm: Permissions)
 
 #[cfg(test)]
 mod tests {
+    #![allow(deprecated)] //rand
+
     use prelude::v1::*;
     use io::prelude::*;
 
@@ -1035,7 +1037,7 @@ mod tests {
             let msg = msg_str.as_bytes();
             check!(w.write(msg));
         }
-        let mut files = check!(fs::read_dir(dir));
+        let files = check!(fs::read_dir(dir));
         let mut mem = [0u8; 4];
         for f in files {
             let f = f.unwrap().path();
@@ -1065,7 +1067,7 @@ mod tests {
         check!(fs::create_dir_all(dir2));
         check!(File::create(&dir2.join("14")));
 
-        let mut files = check!(fs::walk_dir(dir));
+        let files = check!(fs::walk_dir(dir));
         let mut cur = [0u8; 2];
         for f in files {
             let f = f.unwrap().path();
diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs
index e9a8dbb4098..9ef31978236 100644
--- a/src/libstd/io/buffered.rs
+++ b/src/libstd/io/buffered.rs
@@ -497,7 +497,6 @@ mod tests {
         assert_eq!(*writer.get_ref(), [0, 1, 2, 3, 4, 5, 6, 7, 8]);
 
         writer.write(&[9, 10, 11]).unwrap();
-        let a: &[_] = &[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
         assert_eq!(*writer.get_ref(), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]);
 
         writer.flush().unwrap();
@@ -593,7 +592,7 @@ mod tests {
     #[test]
     fn test_lines() {
         let in_buf = b"a\nb\nc";
-        let mut reader = BufReader::with_capacity(2, in_buf);
+        let reader = BufReader::with_capacity(2, in_buf);
         let mut it = reader.lines();
         assert_eq!(it.next(), Some(Ok("a".to_string())));
         assert_eq!(it.next(), Some(Ok("b".to_string())));
@@ -618,14 +617,14 @@ mod tests {
     #[test]
     fn read_char_buffered() {
         let buf = [195u8, 159u8];
-        let mut reader = BufReader::with_capacity(1, &buf[..]);
+        let reader = BufReader::with_capacity(1, &buf[..]);
         assert_eq!(reader.chars().next(), Some(Ok('ß')));
     }
 
     #[test]
     fn test_chars() {
         let buf = [195u8, 159u8, b'a'];
-        let mut reader = BufReader::with_capacity(1, &buf[..]);
+        let reader = BufReader::with_capacity(1, &buf[..]);
         let mut it = reader.chars();
         assert_eq!(it.next(), Some(Ok('ß')));
         assert_eq!(it.next(), Some(Ok('a')));
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs
index c38d52161c9..8ec0e4fe4e4 100644
--- a/src/libstd/io/mod.rs
+++ b/src/libstd/io/mod.rs
@@ -869,12 +869,12 @@ mod tests {
 
     #[test]
     fn split() {
-        let mut buf = Cursor::new(b"12");
+        let buf = Cursor::new(b"12");
         let mut s = buf.split(b'3');
         assert_eq!(s.next(), Some(Ok(vec![b'1', b'2'])));
         assert_eq!(s.next(), None);
 
-        let mut buf = Cursor::new(b"1233");
+        let buf = Cursor::new(b"1233");
         let mut s = buf.split(b'3');
         assert_eq!(s.next(), Some(Ok(vec![b'1', b'2'])));
         assert_eq!(s.next(), Some(Ok(vec![])));
@@ -902,12 +902,12 @@ mod tests {
 
     #[test]
     fn lines() {
-        let mut buf = Cursor::new(b"12");
+        let buf = Cursor::new(b"12");
         let mut s = buf.lines();
         assert_eq!(s.next(), Some(Ok("12".to_string())));
         assert_eq!(s.next(), None);
 
-        let mut buf = Cursor::new(b"12\n\n");
+        let buf = Cursor::new(b"12\n\n");
         let mut s = buf.lines();
         assert_eq!(s.next(), Some(Ok("12".to_string())));
         assert_eq!(s.next(), Some(Ok(String::new())));
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index fbd403ea593..7ce545bbcf0 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -109,7 +109,6 @@
 #![feature(box_syntax)]
 #![feature(collections)]
 #![feature(core)]
-#![feature(hash)]
 #![feature(int_uint)]
 #![feature(lang_items)]
 #![feature(libc)]
@@ -123,7 +122,7 @@
 #![feature(unsafe_destructor)]
 #![feature(unsafe_no_drop_flag)]
 #![feature(macro_reexport)]
-#![cfg_attr(test, feature(test))]
+#![cfg_attr(test, feature(test, rustc_private, env))]
 
 // Don't link to std. We are std.
 #![feature(no_std)]
diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs
index b861b74947e..f99cd2b1d1b 100644
--- a/src/libstd/net/tcp.rs
+++ b/src/libstd/net/tcp.rs
@@ -456,12 +456,6 @@ mod tests {
         }
     }
 
-    pub fn socket_name(addr: SocketAddr) {
-    }
-
-    pub fn peer_name(addr: SocketAddr) {
-    }
-
     #[test]
     fn socket_and_peer_name_ip4() {
         each_ip(&mut |addr| {
diff --git a/src/libstd/net/test.rs b/src/libstd/net/test.rs
index 971fb4b69c8..c70e92884ac 100644
--- a/src/libstd/net/test.rs
+++ b/src/libstd/net/test.rs
@@ -33,7 +33,7 @@ fn base_port() -> u16 {
     let cwd = env::current_dir().unwrap();
     let dirs = ["32-opt", "32-nopt", "64-opt", "64-nopt", "64-opt-vg",
                 "all-opt", "snap3", "dist"];
-    dirs.iter().enumerate().find(|&(i, dir)| {
+    dirs.iter().enumerate().find(|&(_, dir)| {
         cwd.as_str().unwrap().contains(dir)
     }).map(|p| p.0).unwrap_or(0) as u16 * 1000 + 19600
 }
diff --git a/src/libstd/old_io/mod.rs b/src/libstd/old_io/mod.rs
index fc3deb67f41..b82572fc089 100644
--- a/src/libstd/old_io/mod.rs
+++ b/src/libstd/old_io/mod.rs
@@ -240,6 +240,8 @@
 
 #![unstable(feature = "old_io")]
 #![deny(unused_must_use)]
+#![allow(deprecated)] // seriously this is all deprecated
+#![allow(unused_imports)]
 
 pub use self::SeekStyle::*;
 pub use self::FileMode::*;
diff --git a/src/libstd/old_path/mod.rs b/src/libstd/old_path/mod.rs
index e9005aa22bc..4f8976fb2ec 100644
--- a/src/libstd/old_path/mod.rs
+++ b/src/libstd/old_path/mod.rs
@@ -60,6 +60,8 @@
 //! ```
 
 #![unstable(feature = "old_path")]
+#![allow(deprecated)] // seriously this is all deprecated
+#![allow(unused_imports)]
 
 use core::marker::Sized;
 use ffi::CString;
diff --git a/src/libstd/path.rs b/src/libstd/path.rs
index 49a5efec7c2..88543ad85ed 100755
--- a/src/libstd/path.rs
+++ b/src/libstd/path.rs
@@ -1324,7 +1324,6 @@ impl<T: AsOsStr + ?Sized> AsPath for T {
 #[cfg(test)]
 mod tests {
     use super::*;
-    use ffi::OsStr;
     use core::prelude::*;
     use string::{ToString, String};
     use vec::Vec;
diff --git a/src/libstd/process.rs b/src/libstd/process.rs
index 5baa095d359..86604f62171 100644
--- a/src/libstd/process.rs
+++ b/src/libstd/process.rs
@@ -489,18 +489,14 @@ impl Child {
 mod tests {
     use io::ErrorKind;
     use io::prelude::*;
-    use prelude::v1::{Ok, Err, range, drop, Some, None, Vec};
+    use prelude::v1::{Ok, Err, drop, Some, Vec};
     use prelude::v1::{String, Clone};
     use prelude::v1::{SliceExt, Str, StrExt, AsSlice, ToString, GenericPath};
-    use path::Path;
     use old_path;
     use old_io::fs::PathExtensions;
     use rt::running_on_valgrind;
     use str;
-    use super::{Child, Command, Output, ExitStatus, Stdio};
-    use sync::mpsc::channel;
-    use thread;
-    use time::Duration;
+    use super::{Command, Output, Stdio};
 
     // FIXME(#10380) these tests should not all be ignored on android.
 
diff --git a/src/libstd/thread.rs b/src/libstd/thread.rs
index 3653e7e31d5..b6f45eea377 100644
--- a/src/libstd/thread.rs
+++ b/src/libstd/thread.rs
@@ -702,7 +702,7 @@ mod test {
     use boxed::BoxAny;
     use result;
     use std::old_io::{ChanReader, ChanWriter};
-    use super::{Thread, Builder};
+    use super::{Builder};
     use thread;
     use thunk::Thunk;
     use time::Duration;
@@ -767,7 +767,7 @@ mod test {
     #[test]
     #[should_fail]
     fn test_scoped_implicit_panic() {
-        thread::scoped(|| panic!());
+        let _ = thread::scoped(|| panic!());
     }
 
     #[test]