diff options
| author | Tshepang Lekhonkhobe <tshepang@gmail.com> | 2015-02-28 20:07:05 +0200 |
|---|---|---|
| committer | Tshepang Lekhonkhobe <tshepang@gmail.com> | 2015-03-01 09:35:57 +0200 |
| commit | 55ce45e7b52a0a360cf88cba71f59f7d3e9b2346 (patch) | |
| tree | 5c49becf849c32f717a60f05f3bf62f7a02db78c /src/libstd | |
| parent | 890293655251c372ea99694c0c9f0795e2663286 (diff) | |
| download | rust-55ce45e7b52a0a360cf88cba71f59f7d3e9b2346.tar.gz rust-55ce45e7b52a0a360cf88cba71f59f7d3e9b2346.zip | |
remove some compiler warnings
Diffstat (limited to 'src/libstd')
| -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 |
4 files changed, 6 insertions, 8 deletions
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 3b4e15953c4..cf4eb09c19b 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -970,7 +970,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 b5bdeb7f181..de02b6af642 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -124,7 +124,7 @@ #![feature(macro_reexport)] #![feature(hash)] #![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 c24b08deec2..3ed7daf4a0a 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -761,14 +761,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()), |
