diff options
| author | bors <bors@rust-lang.org> | 2013-06-26 00:56:04 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-06-26 00:56:04 -0700 |
| commit | 09b4525f84ea878962f26bcd22d208b9d87d5560 (patch) | |
| tree | 070e713e20e7bda8237002123c3dc561e8b8ccbf /src/libstd | |
| parent | ebed4d00d01753d25fba087c6b5edcbc1406f306 (diff) | |
| parent | c109bed15b79c81fed4277abd0f4a71a221224c1 (diff) | |
| download | rust-09b4525f84ea878962f26bcd22d208b9d87d5560.tar.gz rust-09b4525f84ea878962f26bcd22d208b9d87d5560.zip | |
auto merge of #7113 : alexcrichton/rust/banned-warnings, r=cmr
Reopening of #7031, Closes #6963 I imagine though that this will bounce in bors once or twice... Because attributes can't be cfg(stage0)'d off, there's temporarily a lot of new stage0/stage1+ code.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/libc.rs | 2 | ||||
| -rw-r--r-- | src/libstd/os.rs | 21 | ||||
| -rw-r--r-- | src/libstd/rt/thread_local_storage.rs | 4 | ||||
| -rw-r--r-- | src/libstd/run.rs | 5 | ||||
| -rw-r--r-- | src/libstd/task/spawn.rs | 2 | ||||
| -rw-r--r-- | src/libstd/to_str.rs | 4 | ||||
| -rw-r--r-- | src/libstd/unstable/dynamic_lib.rs | 3 |
7 files changed, 17 insertions, 24 deletions
diff --git a/src/libstd/libc.rs b/src/libstd/libc.rs index 523645e69a5..3c2ae93b656 100644 --- a/src/libstd/libc.rs +++ b/src/libstd/libc.rs @@ -568,7 +568,7 @@ pub mod types { pub mod os { pub mod common { pub mod posix01 { - use libc::types::os::arch::c95::{c_int, c_short}; + use libc::types::os::arch::c95::c_short; use libc::types::os::arch::extra::{int64, time64_t}; use libc::types::os::arch::posix88::{dev_t, ino_t}; use libc::types::os::arch::posix88::mode_t; diff --git a/src/libstd/os.rs b/src/libstd/os.rs index e6b92c0ccc3..112540c405d 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -33,9 +33,8 @@ use io; use iterator::IteratorUtil; use libc; use libc::{c_char, c_void, c_int, size_t}; -use libc::{mode_t, FILE}; +use libc::FILE; use local_data; -use option; use option::{Some, None}; use os; use prelude::*; @@ -181,7 +180,6 @@ pub fn env() -> ~[(~str,~str)] { unsafe { #[cfg(windows)] unsafe fn get_env_pairs() -> ~[~str] { - use libc::types::os::arch::extra::LPTCH; use libc::funcs::extra::kernel32::{ GetEnvironmentStringsA, FreeEnvironmentStringsA @@ -248,10 +246,10 @@ pub fn getenv(n: &str) -> Option<~str> { do with_env_lock { let s = str::as_c_str(n, |s| libc::getenv(s)); if ptr::null::<u8>() == cast::transmute(s) { - option::None::<~str> + None::<~str> } else { let s = cast::transmute(s); - option::Some::<~str>(str::raw::from_buf(s)) + Some::<~str>(str::raw::from_buf(s)) } } } @@ -540,7 +538,7 @@ pub fn homedir() -> Option<Path> { #[cfg(windows)] fn secondary() -> Option<Path> { - do getenv(~"USERPROFILE").chain |p| { + do getenv("USERPROFILE").chain |p| { if !p.is_empty() { Some(Path(p)) } else { @@ -647,9 +645,7 @@ pub fn make_dir(p: &Path, mode: c_int) -> bool { use os::win32::as_utf16_p; // FIXME: turn mode into something useful? #2623 do as_utf16_p(p.to_str()) |buf| { - libc::CreateDirectoryW(buf, unsafe { - cast::transmute(0) - }) + libc::CreateDirectoryW(buf, cast::transmute(0)) != (0 as libc::BOOL) } } @@ -659,7 +655,7 @@ pub fn make_dir(p: &Path, mode: c_int) -> bool { fn mkdir(p: &Path, mode: c_int) -> bool { unsafe { do as_c_charp(p.to_str()) |c| { - libc::mkdir(c, mode as mode_t) == (0 as c_int) + libc::mkdir(c, mode as libc::mode_t) == (0 as c_int) } } } @@ -732,7 +728,6 @@ pub fn list_dir(p: &Path) -> ~[~str] { } #[cfg(windows)] unsafe fn get_list(p: &Path) -> ~[~str] { - use libc::types::os::arch::extra::{LPCTSTR, HANDLE, BOOL}; use libc::consts::os::extra::INVALID_HANDLE_VALUE; use libc::wcslen; use libc::funcs::extra::kernel32::{ @@ -961,7 +956,7 @@ pub fn copy_file(from: &Path, to: &Path) -> bool { // Give the new file the old file's permissions if do str::as_c_str(to.to_str()) |to_buf| { - libc::chmod(to_buf, from_mode as mode_t) + libc::chmod(to_buf, from_mode as libc::mode_t) } != 0 { return false; // should be a condition... } @@ -1329,7 +1324,7 @@ pub fn glob(pattern: &str) -> ~[Path] { /// Returns a vector of Path objects that match the given glob pattern #[cfg(target_os = "win32")] -pub fn glob(pattern: &str) -> ~[Path] { +pub fn glob(_pattern: &str) -> ~[Path] { fail!("glob() is unimplemented on Windows") } diff --git a/src/libstd/rt/thread_local_storage.rs b/src/libstd/rt/thread_local_storage.rs index 7187d2db41c..5041b559ecb 100644 --- a/src/libstd/rt/thread_local_storage.rs +++ b/src/libstd/rt/thread_local_storage.rs @@ -60,13 +60,13 @@ pub type Key = DWORD; #[cfg(windows)] pub unsafe fn create(key: &mut Key) { static TLS_OUT_OF_INDEXES: DWORD = 0xFFFFFFFF; - *key = unsafe { TlsAlloc() }; + *key = TlsAlloc(); assert!(*key != TLS_OUT_OF_INDEXES); } #[cfg(windows)] pub unsafe fn set(key: Key, value: *mut c_void) { - unsafe { assert!(0 != TlsSetValue(key, value)) } + assert!(0 != TlsSetValue(key, value)) } #[cfg(windows)] diff --git a/src/libstd/run.rs b/src/libstd/run.rs index 08bb7ee7281..ce6a68beec7 100644 --- a/src/libstd/run.rs +++ b/src/libstd/run.rs @@ -12,11 +12,10 @@ #[allow(missing_doc)]; -use iterator::IteratorUtil; use cast; use comm::{stream, SharedChan, GenericChan, GenericPort}; -use int; use io; +use iterator::IteratorUtil; use libc::{pid_t, c_void, c_int}; use libc; use option::{Some, None}; @@ -465,7 +464,6 @@ fn spawn_process_os(prog: &str, args: &[~str], use libc::funcs::extra::msvcrt::get_osfhandle; use sys; - use uint; unsafe { @@ -638,6 +636,7 @@ fn spawn_process_os(prog: &str, args: &[~str], use libc::funcs::posix88::unistd::{fork, dup2, close, chdir, execvp}; use libc::funcs::bsd44::getdtablesize; + use int; mod rustrt { use libc::c_void; diff --git a/src/libstd/task/spawn.rs b/src/libstd/task/spawn.rs index a3c1407c300..95fc53c1b55 100644 --- a/src/libstd/task/spawn.rs +++ b/src/libstd/task/spawn.rs @@ -91,7 +91,7 @@ use uint; use util; use unstable::sync::{Exclusive, exclusive}; use rt::local::Local; -use iterator::{IteratorUtil}; +use iterator::IteratorUtil; #[cfg(test)] use task::default_task_opts; #[cfg(test)] use comm; diff --git a/src/libstd/to_str.rs b/src/libstd/to_str.rs index 4d5bc0f8842..ea0e212b14f 100644 --- a/src/libstd/to_str.rs +++ b/src/libstd/to_str.rs @@ -17,8 +17,8 @@ The `ToStr` trait for converting to strings use str::OwnedStr; use hashmap::HashMap; use hashmap::HashSet; -use iterator::IteratorUtil; use hash::Hash; +use iterator::IteratorUtil; use cmp::Eq; use vec::ImmutableVector; @@ -177,7 +177,7 @@ impl<A:ToStr> ToStr for @[A] { mod tests { use hashmap::HashMap; use hashmap::HashSet; - use container::{Set,Map}; + use container::{Set, Map}; #[test] fn test_simple_types() { assert_eq!(1i.to_str(), ~"1"); diff --git a/src/libstd/unstable/dynamic_lib.rs b/src/libstd/unstable/dynamic_lib.rs index 9ea35396915..e01f99adc94 100644 --- a/src/libstd/unstable/dynamic_lib.rs +++ b/src/libstd/unstable/dynamic_lib.rs @@ -164,7 +164,6 @@ mod dl { use libc; use path; use ptr; - use str; use task; use result::*; @@ -175,7 +174,7 @@ mod dl { } pub unsafe fn open_internal() -> *libc::c_void { - let mut handle = ptr::null(); + let handle = ptr::null(); GetModuleHandleExW(0 as libc::DWORD, ptr::null(), &handle as **libc::c_void); handle } |
