diff options
| author | bors <bors@rust-lang.org> | 2016-01-26 22:10:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-01-26 22:10:10 +0000 |
| commit | 4b615854f00ba17ad704155e1d3196c17a6edb62 (patch) | |
| tree | 7fb690a89170c12be9c66adb00d93ddf9aa377c3 /src/libstd/sys/windows | |
| parent | a9e139b66c786423334c5f09f71ec8b0492742f8 (diff) | |
| parent | cb343c33acf0f9833d8d6eb637234acf4321976b (diff) | |
| download | rust-4b615854f00ba17ad704155e1d3196c17a6edb62.tar.gz rust-4b615854f00ba17ad704155e1d3196c17a6edb62.zip | |
Auto merge of #31120 - alexcrichton:attribute-deny-warnings, r=brson
This commit removes the `-D warnings` flag being passed through the makefiles to all crates to instead be a crate attribute. We want these attributes always applied for all our standard builds, and this is more amenable to Cargo-based builds as well. Note that all `deny(warnings)` attributes are gated with a `cfg(stage0)` attribute currently to match the same semantics we have today
Diffstat (limited to 'src/libstd/sys/windows')
| -rw-r--r-- | src/libstd/sys/windows/fs.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/windows/mod.rs | 42 | ||||
| -rw-r--r-- | src/libstd/sys/windows/process.rs | 1 | ||||
| -rw-r--r-- | src/libstd/sys/windows/stack_overflow.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/thread.rs | 1 |
5 files changed, 25 insertions, 25 deletions
diff --git a/src/libstd/sys/windows/fs.rs b/src/libstd/sys/windows/fs.rs index 60e3f7c22bd..a8b82ef5f29 100644 --- a/src/libstd/sys/windows/fs.rs +++ b/src/libstd/sys/windows/fs.rs @@ -639,7 +639,7 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> { fn directory_junctions_are_directories() { use ffi::OsStr; use env; - use rand::{self, StdRng, Rng}; + use rand::{self, Rng}; use vec::Vec; macro_rules! t { @@ -683,7 +683,7 @@ fn directory_junctions_are_directories() { let mut data = [0u8; c::MAXIMUM_REPARSE_DATA_BUFFER_SIZE]; let mut db = data.as_mut_ptr() as *mut c::REPARSE_MOUNTPOINT_DATA_BUFFER; - let mut buf = &mut (*db).ReparseTarget as *mut _; + let buf = &mut (*db).ReparseTarget as *mut _; let mut i = 0; let v = br"\??\"; let v = v.iter().map(|x| *x as u16); diff --git a/src/libstd/sys/windows/mod.rs b/src/libstd/sys/windows/mod.rs index 16c4ae8257c..9ecef5ee92c 100644 --- a/src/libstd/sys/windows/mod.rs +++ b/src/libstd/sys/windows/mod.rs @@ -8,9 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] +#![allow(missing_docs, bad_style)] use prelude::v1::*; @@ -20,7 +18,6 @@ use num::Zero; use os::windows::ffi::{OsStrExt, OsStringExt}; use path::PathBuf; use time::Duration; -use alloc::oom; #[macro_use] pub mod compat; @@ -43,25 +40,26 @@ pub mod thread_local; pub mod time; pub mod stdio; -// See comment in sys/unix/mod.rs -fn oom_handler() -> ! { - use intrinsics; - use ptr; - let msg = "fatal runtime error: out of memory\n"; - unsafe { - // WriteFile silently fails if it is passed an invalid handle, so there - // is no need to check the result of GetStdHandle. - c::WriteFile(c::GetStdHandle(c::STD_ERROR_HANDLE), - msg.as_ptr() as c::LPVOID, - msg.len() as c::DWORD, - ptr::null_mut(), - ptr::null_mut()); - intrinsics::abort(); - } -} - +#[cfg(not(test))] pub fn init() { - oom::set_oom_handler(oom_handler); + ::alloc::oom::set_oom_handler(oom_handler); + + // See comment in sys/unix/mod.rs + fn oom_handler() -> ! { + use intrinsics; + use ptr; + let msg = "fatal runtime error: out of memory\n"; + unsafe { + // WriteFile silently fails if it is passed an invalid handle, so + // there is no need to check the result of GetStdHandle. + c::WriteFile(c::GetStdHandle(c::STD_ERROR_HANDLE), + msg.as_ptr() as c::LPVOID, + msg.len() as c::DWORD, + ptr::null_mut(), + ptr::null_mut()); + intrinsics::abort(); + } + } } pub fn decode_error_kind(errno: i32) -> ErrorKind { diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs index 61f73b00265..8b17a053162 100644 --- a/src/libstd/sys/windows/process.rs +++ b/src/libstd/sys/windows/process.rs @@ -391,7 +391,6 @@ impl Stdio { #[cfg(test)] mod tests { use prelude::v1::*; - use str; use ffi::{OsStr, OsString}; use super::make_command_line; diff --git a/src/libstd/sys/windows/stack_overflow.rs b/src/libstd/sys/windows/stack_overflow.rs index 01317bec0de..4a406d70e63 100644 --- a/src/libstd/sys/windows/stack_overflow.rs +++ b/src/libstd/sys/windows/stack_overflow.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![cfg_attr(test, allow(dead_code))] + use sys_common::util::report_overflow; use sys::c; diff --git a/src/libstd/sys/windows/thread.rs b/src/libstd/sys/windows/thread.rs index 1ba85867563..b18772c0c24 100644 --- a/src/libstd/sys/windows/thread.rs +++ b/src/libstd/sys/windows/thread.rs @@ -83,6 +83,7 @@ impl Thread { pub fn into_handle(self) -> Handle { self.handle } } +#[cfg_attr(test, allow(dead_code))] pub mod guard { pub unsafe fn current() -> Option<usize> { None } pub unsafe fn init() -> Option<usize> { None } |
