summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-03-23 15:54:39 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-03-23 17:10:19 -0700
commit29b54387b88bdf43c00849e3483c2297723f5a73 (patch)
tree72d467004da043e823a94690e89e3a2afae8ba2f /src/libstd/sys
parent3112716f123bc0f6f69c4df26894241f41c488ce (diff)
downloadrust-29b54387b88bdf43c00849e3483c2297723f5a73.tar.gz
rust-29b54387b88bdf43c00849e3483c2297723f5a73.zip
Test fixes and rebase conflicts, round 2
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/unix/thread.rs5
-rw-r--r--src/libstd/sys/windows/fs2.rs2
-rw-r--r--src/libstd/sys/windows/mod.rs4
-rw-r--r--src/libstd/sys/windows/os.rs5
4 files changed, 6 insertions, 10 deletions
diff --git a/src/libstd/sys/unix/thread.rs b/src/libstd/sys/unix/thread.rs
index eb2a6dc08bf..eb61f21aacd 100644
--- a/src/libstd/sys/unix/thread.rs
+++ b/src/libstd/sys/unix/thread.rs
@@ -13,14 +13,12 @@
 use core::prelude::*;
 
 use cmp;
-use dynamic_lib::DynamicLibrary;
 use ffi::CString;
 use io;
 use libc::consts::os::posix01::PTHREAD_STACK_MIN;
 use libc;
 use mem;
 use ptr;
-use sync::{Once, ONCE_INIT};
 use sys::os;
 use thunk::Thunk;
 use time::Duration;
@@ -322,6 +320,9 @@ pub fn sleep(dur: Duration) {
 // dependency on libc6 (#23628).
 #[cfg(target_os = "linux")]
 fn min_stack_size(attr: *const libc::pthread_attr_t) -> libc::size_t {
+    use dynamic_lib::DynamicLibrary;
+    use sync::{Once, ONCE_INIT};
+
     type F = unsafe extern "C" fn(*const libc::pthread_attr_t) -> libc::size_t;
     static INIT: Once = ONCE_INIT;
     static mut __pthread_get_minstack: Option<F> = None;
diff --git a/src/libstd/sys/windows/fs2.rs b/src/libstd/sys/windows/fs2.rs
index 117f819eeeb..99835265111 100644
--- a/src/libstd/sys/windows/fs2.rs
+++ b/src/libstd/sys/windows/fs2.rs
@@ -372,7 +372,7 @@ pub fn readlink(p: &Path) -> io::Result<PathBuf> {
                                   sz - 1,
                                   libc::VOLUME_NAME_DOS)
     }, |s| OsStringExt::from_wide(s)));
-    Ok(PathBuf::new(&ret))
+    Ok(PathBuf::from(&ret))
 }
 
 pub fn symlink(src: &Path, dst: &Path) -> io::Result<()> {
diff --git a/src/libstd/sys/windows/mod.rs b/src/libstd/sys/windows/mod.rs
index eeaf4ced072..b1ceac9b902 100644
--- a/src/libstd/sys/windows/mod.rs
+++ b/src/libstd/sys/windows/mod.rs
@@ -304,9 +304,7 @@ fn fill_utf16_buf_new<F1, F2, T>(f1: F1, f2: F2) -> io::Result<T>
 }
 
 fn os2path(s: &[u16]) -> PathBuf {
-    let os = <OsString as OsStringExt>::from_wide(s);
-    // FIXME(#22751) should consume `os`
-    PathBuf::new(&os)
+    PathBuf::from(OsString::from_wide(s))
 }
 
 pub fn truncate_utf16_at_nul<'a>(v: &'a [u16]) -> &'a [u16] {
diff --git a/src/libstd/sys/windows/os.rs b/src/libstd/sys/windows/os.rs
index 4f6c4c9aab3..83d06371734 100644
--- a/src/libstd/sys/windows/os.rs
+++ b/src/libstd/sys/windows/os.rs
@@ -363,10 +363,7 @@ pub fn temp_dir() -> PathBuf {
 pub fn home_dir() -> Option<PathBuf> {
     getenv("HOME".as_os_str()).or_else(|| {
         getenv("USERPROFILE".as_os_str())
-    }).map(|os| {
-        // FIXME(#22751) should consume `os`
-        PathBuf::new(&os)
-    }).or_else(|| unsafe {
+    }).map(PathBuf::from).or_else(|| unsafe {
         let me = c::GetCurrentProcess();
         let mut token = ptr::null_mut();
         if c::OpenProcessToken(me, c::TOKEN_READ, &mut token) == 0 {