diff options
Diffstat (limited to 'src/libstd/os.rs')
| -rw-r--r-- | src/libstd/os.rs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/libstd/os.rs b/src/libstd/os.rs index ffe762450d0..46233a46ee5 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -52,12 +52,19 @@ use option::Option::{Some, None}; use option::Option; use old_path::{Path, GenericPath, BytesContainer}; use path::{self, PathBuf}; +#[cfg(stage0)] use ptr::PtrExt; use ptr; use result::Result::{Err, Ok}; use result::Result; +#[cfg(stage0)] use slice::{AsSlice, SliceExt}; +#[cfg(not(stage0))] +use slice::AsSlice; +#[cfg(stage0)] use str::{Str, StrExt}; +#[cfg(not(stage0))] +use str::Str; use str; use string::{String, ToString}; use sync::atomic::{AtomicIsize, ATOMIC_ISIZE_INIT, Ordering}; @@ -210,7 +217,7 @@ pub fn getenv_as_bytes(n: &str) -> Option<Vec<u8>> { #[cfg(unix)] fn byteify(s: OsString) -> Vec<u8> { - use os::unix::*; + use os::unix::prelude::*; s.into_vec() } #[cfg(windows)] @@ -238,7 +245,7 @@ fn byteify(s: OsString) -> Vec<u8> { pub fn setenv<T: BytesContainer>(n: &str, v: T) { #[cfg(unix)] fn _setenv(n: &str, v: &[u8]) { - use os::unix::*; + use os::unix::prelude::*; let v: OsString = OsStringExt::from_vec(v.to_vec()); env::set_var(n, &v) } @@ -591,7 +598,6 @@ pub fn get_exit_status() -> int { unsafe fn load_argc_and_argv(argc: int, argv: *const *const c_char) -> Vec<Vec<u8>> { use ffi::CStr; - use iter::range; (0..argc).map(|i| { CStr::from_ptr(*argv.offset(i)).to_bytes().to_vec() @@ -1709,13 +1715,13 @@ mod tests { #[cfg(not(windows))] fn get_fd(file: &File) -> libc::c_int { - use os::unix::AsRawFd; + use os::unix::prelude::*; file.as_raw_fd() } #[cfg(windows)] fn get_fd(file: &File) -> libc::HANDLE { - use os::windows::AsRawHandle; + use os::windows::prelude::*; file.as_raw_handle() } |
