]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/sys/windows/mod.rs
std: Clean out deprecated APIs
[rust.git] / src / libstd / sys / windows / mod.rs
index 16c4ae8257c132d7018e018fcab09c682f8f8db6..384940e4dc446edbe0f0101378000b60a431727b 100644 (file)
@@ -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::*;
 
 use os::windows::ffi::{OsStrExt, OsStringExt};
 use path::PathBuf;
 use time::Duration;
-use alloc::oom;
 
 #[macro_use] pub mod compat;
 
 pub mod backtrace;
 pub mod c;
 pub mod condvar;
+pub mod dynamic_lib;
 pub mod ext;
 pub mod fs;
 pub mod handle;
@@ -36,6 +34,7 @@
 pub mod os_str;
 pub mod pipe;
 pub mod process;
+pub mod rand;
 pub mod rwlock;
 pub mod stack_overflow;
 pub mod thread;
 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 {