diff options
| author | bors <bors@rust-lang.org> | 2015-03-04 12:16:51 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-03-04 12:16:51 +0000 |
| commit | bdf6e4fcf5ed8b8fe3c281040414e4f6a6afb8d6 (patch) | |
| tree | 609f5fc3b538d928ad4f36691110c2928779c358 | |
| parent | 6e055c3f0041067000dfae7bbc2b0383a8fed19e (diff) | |
| parent | 55ce45e7b52a0a360cf88cba71f59f7d3e9b2346 (diff) | |
| download | rust-bdf6e4fcf5ed8b8fe3c281040414e4f6a6afb8d6.tar.gz rust-bdf6e4fcf5ed8b8fe3c281040414e4f6a6afb8d6.zip | |
Auto merge of #22920 - tshepang:remove-some-warnings, r=huonw
| -rw-r--r-- | src/liballoc/lib.rs | 1 | ||||
| -rw-r--r-- | src/libcollections/slice.rs | 4 | ||||
| -rw-r--r-- | src/libcoretest/hash/mod.rs | 2 | ||||
| -rw-r--r-- | src/libcoretest/str.rs | 6 | ||||
| -rw-r--r-- | src/librand/rand_impls.rs | 1 | ||||
| -rw-r--r-- | src/librbml/io.rs | 18 | ||||
| -rw-r--r-- | src/libstd/ffi/c_str.rs | 5 | ||||
| -rw-r--r-- | src/libstd/io/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/lib.rs | 2 | ||||
| -rw-r--r-- | src/libstd/process.rs | 5 | ||||
| -rw-r--r-- | src/libterm/terminfo/searcher.rs | 6 | ||||
| -rw-r--r-- | src/libtest/lib.rs | 4 |
12 files changed, 25 insertions, 31 deletions
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index b1fdf139b0c..7c65a99d4b0 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -73,7 +73,6 @@ #![feature(unboxed_closures)] #![feature(unsafe_no_drop_flag)] #![feature(core)] -#![feature(unique)] #![cfg_attr(test, feature(test, alloc, rustc_private))] #![cfg_attr(all(not(feature = "external_funcs"), not(feature = "external_crate")), feature(libc))] diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index ecff2c7cc4b..23b256568da 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -2176,8 +2176,8 @@ mod tests { fn test_connect() { let v: [Vec<i32>; 0] = []; assert_eq!(v.connect(&0), []); - assert_eq!([vec![1i], vec![2, 3]].connect(&0), [1, 0, 2, 3]); - assert_eq!([vec![1i], vec![2], vec![3]].connect(&0), [1, 0, 2, 0, 3]); + assert_eq!([vec![1], vec![2, 3]].connect(&0), [1, 0, 2, 3]); + assert_eq!([vec![1], vec![2], vec![3]].connect(&0), [1, 0, 2, 0, 3]); let v: [&[_]; 2] = [&[1], &[2, 3]]; assert_eq!(v.connect(&0), [1, 0, 2, 3]); diff --git a/src/libcoretest/hash/mod.rs b/src/libcoretest/hash/mod.rs index da96680d84b..3433813e7b5 100644 --- a/src/libcoretest/hash/mod.rs +++ b/src/libcoretest/hash/mod.rs @@ -86,7 +86,7 @@ struct CustomHasher { output: u64 } impl Hasher for CustomHasher { fn finish(&self) -> u64 { self.output } - fn write(&mut self, data: &[u8]) { panic!() } + fn write(&mut self, _: &[u8]) { panic!() } fn write_u64(&mut self, data: u64) { self.output = data; } } diff --git a/src/libcoretest/str.rs b/src/libcoretest/str.rs index 019f935911f..a89d3380707 100644 --- a/src/libcoretest/str.rs +++ b/src/libcoretest/str.rs @@ -188,15 +188,13 @@ fn trim_ws() { mod pattern { use std::str::Pattern; - use std::str::{Searcher, ReverseSearcher, DoubleEndedSearcher}; + use std::str::{Searcher, ReverseSearcher}; use std::str::SearchStep::{self, Match, Reject, Done}; macro_rules! make_test { ($name:ident, $p:expr, $h:expr, [$($e:expr,)*]) => { mod $name { - use std::str::Pattern; - use std::str::{Searcher, ReverseSearcher, DoubleEndedSearcher}; - use std::str::SearchStep::{self, Match, Reject, Done}; + use std::str::SearchStep::{Match, Reject}; use super::{cmp_search_to_vec}; #[test] fn fwd() { diff --git a/src/librand/rand_impls.rs b/src/librand/rand_impls.rs index c8a757079c3..e2a5276cc78 100644 --- a/src/librand/rand_impls.rs +++ b/src/librand/rand_impls.rs @@ -214,7 +214,6 @@ impl<T:Rand> Rand for Option<T> { #[cfg(test)] mod tests { - use std::prelude::v1::*; use std::rand::{Rng, thread_rng, Open01, Closed01}; struct ConstantRng(u64); diff --git a/src/librbml/io.rs b/src/librbml/io.rs index 4ef3c5bc206..fc0a9d29ed6 100644 --- a/src/librbml/io.rs +++ b/src/librbml/io.rs @@ -140,32 +140,32 @@ mod tests { fn test_seekable_mem_writer() { let mut writer = SeekableMemWriter::new(); assert_eq!(writer.tell(), Ok(0)); - writer.write(&[0]).unwrap(); + writer.write_all(&[0]).unwrap(); assert_eq!(writer.tell(), Ok(1)); - writer.write(&[1, 2, 3]).unwrap(); - writer.write(&[4, 5, 6, 7]).unwrap(); + writer.write_all(&[1, 2, 3]).unwrap(); + writer.write_all(&[4, 5, 6, 7]).unwrap(); assert_eq!(writer.tell(), Ok(8)); let b: &[_] = &[0, 1, 2, 3, 4, 5, 6, 7]; assert_eq!(writer.get_ref(), b); writer.seek(0, old_io::SeekSet).unwrap(); assert_eq!(writer.tell(), Ok(0)); - writer.write(&[3, 4]).unwrap(); + writer.write_all(&[3, 4]).unwrap(); let b: &[_] = &[3, 4, 2, 3, 4, 5, 6, 7]; assert_eq!(writer.get_ref(), b); writer.seek(1, old_io::SeekCur).unwrap(); - writer.write(&[0, 1]).unwrap(); + writer.write_all(&[0, 1]).unwrap(); let b: &[_] = &[3, 4, 2, 0, 1, 5, 6, 7]; assert_eq!(writer.get_ref(), b); writer.seek(-1, old_io::SeekEnd).unwrap(); - writer.write(&[1, 2]).unwrap(); + writer.write_all(&[1, 2]).unwrap(); let b: &[_] = &[3, 4, 2, 0, 1, 5, 6, 1, 2]; assert_eq!(writer.get_ref(), b); writer.seek(1, old_io::SeekEnd).unwrap(); - writer.write(&[1]).unwrap(); + writer.write_all(&[1]).unwrap(); let b: &[_] = &[3, 4, 2, 0, 1, 5, 6, 1, 2, 0, 1]; assert_eq!(writer.get_ref(), b); } @@ -174,7 +174,7 @@ mod tests { fn seek_past_end() { let mut r = SeekableMemWriter::new(); r.seek(10, old_io::SeekSet).unwrap(); - assert!(r.write(&[3]).is_ok()); + assert!(r.write_all(&[3]).is_ok()); } #[test] @@ -190,7 +190,7 @@ mod tests { b.iter(|| { let mut wr = SeekableMemWriter::new(); for _ in 0..times { - wr.write(&src).unwrap(); + wr.write_all(&src).unwrap(); } let v = wr.unwrap(); diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index 69bcc82f682..c94edb9d2a1 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -422,15 +422,14 @@ mod tests { use prelude::v1::*; use super::*; use libc; - use mem; #[test] fn c_to_rust() { let data = b"123\0"; let ptr = data.as_ptr() as *const libc::c_char; unsafe { - assert_eq!(c_str_to_bytes(&ptr), b"123"); - assert_eq!(c_str_to_bytes_with_nul(&ptr), b"123\0"); + assert_eq!(CStr::from_ptr(ptr).to_bytes(), b"123"); + assert_eq!(CStr::from_ptr(ptr).to_bytes_with_nul(), b"123\0"); } } diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 5510c0203e6..46547ac5836 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -975,7 +975,7 @@ mod tests { struct R; impl Read for R { - fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { + fn read(&mut self, _: &mut [u8]) -> io::Result<usize> { Err(io::Error::new(io::ErrorKind::Other, "", None)) } } diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index c890af631f0..569906047aa 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -125,7 +125,7 @@ #![feature(hash)] #![feature(int_uint)] #![feature(unique)] -#![cfg_attr(test, feature(test, rustc_private, env))] +#![cfg_attr(test, feature(test, rustc_private))] // Don't link to std. We are std. #![feature(no_std)] diff --git a/src/libstd/process.rs b/src/libstd/process.rs index b578b5e3d60..79028f49e68 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -803,14 +803,13 @@ mod tests { #[cfg(not(target_os="android"))] #[test] fn test_inherit_env() { - use os; + use std::env; if running_on_valgrind() { return; } let result = env_cmd().output().unwrap(); let output = String::from_utf8(result.stdout).unwrap(); - let r = os::env(); - for &(ref k, ref v) in &r { + for (ref k, ref v) in env::vars() { // don't check windows magical empty-named variables assert!(k.is_empty() || output.contains(format!("{}={}", *k, *v).as_slice()), diff --git a/src/libterm/terminfo/searcher.rs b/src/libterm/terminfo/searcher.rs index a0cd7842070..15f7f3884ec 100644 --- a/src/libterm/terminfo/searcher.rs +++ b/src/libterm/terminfo/searcher.rs @@ -96,7 +96,7 @@ pub fn open(term: &str) -> Result<File, String> { fn test_get_dbpath_for_term() { // woefully inadequate test coverage // note: current tests won't work with non-standard terminfo hierarchies (e.g. OS X's) - use std::os::{setenv, unsetenv}; + use std::env; // FIXME (#9639): This needs to handle non-utf8 paths fn x(t: &str) -> String { let p = get_dbpath_for_term(t).expect("no terminfo entry found"); @@ -104,9 +104,9 @@ fn test_get_dbpath_for_term() { }; assert!(x("screen") == "/usr/share/terminfo/s/screen"); assert!(get_dbpath_for_term("") == None); - setenv("TERMINFO_DIRS", ":"); + env::set_var("TERMINFO_DIRS", ":"); assert!(x("screen") == "/usr/share/terminfo/s/screen"); - unsetenv("TERMINFO_DIRS"); + env::remove_var("TERMINFO_DIRS"); } #[test] diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index a144904903e..3fbb07d03a8 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -732,8 +732,8 @@ fn should_sort_failures_before_printing_them() { Pretty(_) => unreachable!() }; - let apos = s.find_str("a").unwrap(); - let bpos = s.find_str("b").unwrap(); + let apos = s.find("a").unwrap(); + let bpos = s.find("b").unwrap(); assert!(apos < bpos); } |
