diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-03-09 20:04:35 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-03-12 10:23:27 -0700 |
| commit | c933d44f7bb908aa520250b608f85bfacfccc337 (patch) | |
| tree | 82cab26f340e4cfdc5d373d621fd77713f6c6d78 /src/libstd/sys/windows | |
| parent | 206ee0e8533dd3e1ee324da445e02ad79c51e849 (diff) | |
| download | rust-c933d44f7bb908aa520250b608f85bfacfccc337.tar.gz rust-c933d44f7bb908aa520250b608f85bfacfccc337.zip | |
std: Remove #[allow] directives in sys modules
These were suppressing lots of interesting warnings! Turns out there was also quite a bit of dead code.
Diffstat (limited to 'src/libstd/sys/windows')
| -rw-r--r-- | src/libstd/sys/windows/backtrace.rs | 11 | ||||
| -rw-r--r-- | src/libstd/sys/windows/fs.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/windows/mod.rs | 21 | ||||
| -rw-r--r-- | src/libstd/sys/windows/process.rs | 3 | ||||
| -rw-r--r-- | src/libstd/sys/windows/tcp.rs | 3 | ||||
| -rw-r--r-- | src/libstd/sys/windows/timer.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/windows/tty.rs | 2 |
7 files changed, 12 insertions, 36 deletions
diff --git a/src/libstd/sys/windows/backtrace.rs b/src/libstd/sys/windows/backtrace.rs index 51cf3032423..8de2fe1336f 100644 --- a/src/libstd/sys/windows/backtrace.rs +++ b/src/libstd/sys/windows/backtrace.rs @@ -24,19 +24,16 @@ #![allow(dead_code)] +use prelude::v1::*; + use dynamic_lib::DynamicLibrary; use ffi::CStr; use intrinsics; -use old_io::{IoResult, Writer}; +use old_io::IoResult; use libc; use mem; -use ops::Drop; -use option::Option::{Some}; -use old_path::Path; use ptr; -use result::Result::{Ok, Err}; -use slice::SliceExt; -use str::{self, StrExt}; +use str; use sync::{StaticMutex, MUTEX_INIT}; use sys_common::backtrace::*; diff --git a/src/libstd/sys/windows/fs.rs b/src/libstd/sys/windows/fs.rs index 309d6c9dc48..5e6fcc66407 100644 --- a/src/libstd/sys/windows/fs.rs +++ b/src/libstd/sys/windows/fs.rs @@ -18,7 +18,7 @@ use old_io; use prelude::v1::*; use sys; -use sys_common::{mkerr_libc}; +use sys_common::{self, mkerr_libc}; use old_io::{FilePermission, Write, UnstableFileStat, Open, FileAccess, FileMode}; use old_io::{IoResult, IoError, FileStat, SeekStyle}; @@ -434,7 +434,7 @@ pub fn stat(p: &Path) -> IoResult<FileStat> { // FIXME: move this to platform-specific modules (for now)? pub fn lstat(_p: &Path) -> IoResult<FileStat> { // FIXME: implementation is missing - Err(super::unimpl()) + Err(sys_common::unimpl()) } pub fn utime(p: &Path, atime: u64, mtime: u64) -> IoResult<()> { diff --git a/src/libstd/sys/windows/mod.rs b/src/libstd/sys/windows/mod.rs index 3bdadbb9012..46085826e60 100644 --- a/src/libstd/sys/windows/mod.rs +++ b/src/libstd/sys/windows/mod.rs @@ -24,17 +24,6 @@ use os::windows::{OsStrExt, OsStringExt}; use path::PathBuf; use sync::{Once, ONCE_INIT}; -macro_rules! helper_init { (static $name:ident: Helper<$m:ty>) => ( - static $name: Helper<$m> = Helper { - lock: ::sync::MUTEX_INIT, - cond: ::sync::CONDVAR_INIT, - chan: ::cell::UnsafeCell { value: 0 as *mut ::sync::mpsc::Sender<$m> }, - signal: ::cell::UnsafeCell { value: 0 }, - initialized: ::cell::UnsafeCell { value: false }, - shutdown: ::cell::UnsafeCell { value: false }, - }; -) } - pub mod backtrace; pub mod c; pub mod condvar; @@ -216,15 +205,7 @@ pub fn init_net() { } } -pub fn unimpl() -> IoError { - IoError { - kind: old_io::IoUnavailable, - desc: "operation is not implemented", - detail: None, - } -} - -fn to_utf16(s: Option<&str>) -> IoResult<Vec<u16>> { +pub fn to_utf16(s: Option<&str>) -> IoResult<Vec<u16>> { match s { Some(s) => Ok(to_utf16_os(OsStr::from_str(s))), None => Err(IoError { diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs index ca3ed54eb03..119ff3dbcc8 100644 --- a/src/libstd/sys/windows/process.rs +++ b/src/libstd/sys/windows/process.rs @@ -29,7 +29,6 @@ use ptr; use str; use sync::{StaticMutex, MUTEX_INIT}; use sys::fs::FileDesc; - use sys::timer; use sys_common::{AsInner, timeout}; @@ -129,8 +128,6 @@ impl Process { use libc::funcs::extra::msvcrt::get_osfhandle; use mem; - use iter::IteratorExt; - use str::StrExt; if cfg.gid().is_some() || cfg.uid().is_some() { return Err(IoError { diff --git a/src/libstd/sys/windows/tcp.rs b/src/libstd/sys/windows/tcp.rs index 8547de145f8..6e46bf97d1b 100644 --- a/src/libstd/sys/windows/tcp.rs +++ b/src/libstd/sys/windows/tcp.rs @@ -10,12 +10,13 @@ #![allow(deprecated)] +use prelude::v1::*; + use old_io::net::ip; use old_io::IoResult; use libc; use mem; use ptr; -use prelude::v1::*; use super::{last_error, last_net_error, sock_t}; use sync::Arc; use sync::atomic::{AtomicBool, Ordering}; diff --git a/src/libstd/sys/windows/timer.rs b/src/libstd/sys/windows/timer.rs index d156dd801f9..a23a90a9cf8 100644 --- a/src/libstd/sys/windows/timer.rs +++ b/src/libstd/sys/windows/timer.rs @@ -20,15 +20,15 @@ //! Other than that, the implementation is pretty straightforward in terms of //! the other two implementations of timers with nothing *that* new showing up. -use self::Req::*; use prelude::v1::*; +use self::Req::*; use libc; use ptr; use old_io::IoResult; -use sync::mpsc::{channel, Sender, Receiver, TryRecvError}; use sys_common::helper_thread::Helper; +use sync::mpsc::{channel, TryRecvError, Sender, Receiver}; helper_init! { static HELPER: Helper<Req> } diff --git a/src/libstd/sys/windows/tty.rs b/src/libstd/sys/windows/tty.rs index c9bac69c434..37dce423a68 100644 --- a/src/libstd/sys/windows/tty.rs +++ b/src/libstd/sys/windows/tty.rs @@ -38,7 +38,7 @@ use str::from_utf8; use super::c::{ENABLE_ECHO_INPUT, ENABLE_EXTENDED_FLAGS}; use super::c::{ENABLE_INSERT_MODE, ENABLE_LINE_INPUT}; use super::c::{ENABLE_PROCESSED_INPUT, ENABLE_QUICK_EDIT_MODE}; -use super::c::{CONSOLE_SCREEN_BUFFER_INFO}; +use super::c::CONSOLE_SCREEN_BUFFER_INFO; use super::c::{ReadConsoleW, WriteConsoleW, GetConsoleMode, SetConsoleMode}; use super::c::{GetConsoleScreenBufferInfo}; |
