Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions library/std/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::ffi::{OsStr, OsString};
use crate::num::NonZero;
use crate::ops::Try;
use crate::path::{Path, PathBuf};
use crate::sys::{env as env_imp, os as os_imp};
use crate::sys::{env as env_imp, paths as paths_imp};
use crate::{array, fmt, io, sys};

/// Returns the current working directory as a [`PathBuf`].
Expand Down Expand Up @@ -51,7 +51,7 @@ use crate::{array, fmt, io, sys};
#[doc(alias = "GetCurrentDirectory")]
#[stable(feature = "env", since = "1.0.0")]
pub fn current_dir() -> io::Result<PathBuf> {
os_imp::getcwd()
paths_imp::getcwd()
}

/// Changes the current working directory to the specified path.
Expand All @@ -78,7 +78,7 @@ pub fn current_dir() -> io::Result<PathBuf> {
#[doc(alias = "chdir", alias = "SetCurrentDirectory", alias = "SetCurrentDirectoryW")]
#[stable(feature = "env", since = "1.0.0")]
pub fn set_current_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
os_imp::chdir(path.as_ref())
paths_imp::chdir(path.as_ref())
}

/// An iterator over a snapshot of the environment variables of this process.
Expand Down Expand Up @@ -444,7 +444,7 @@ pub unsafe fn remove_var<K: AsRef<OsStr>>(key: K) {
#[must_use = "iterators are lazy and do nothing unless consumed"]
#[stable(feature = "env", since = "1.0.0")]
pub struct SplitPaths<'a> {
inner: os_imp::SplitPaths<'a>,
inner: paths_imp::SplitPaths<'a>,
}

/// Parses input according to platform conventions for the `PATH`
Expand Down Expand Up @@ -480,7 +480,7 @@ pub struct SplitPaths<'a> {
/// ```
#[stable(feature = "env", since = "1.0.0")]
pub fn split_paths<T: AsRef<OsStr> + ?Sized>(unparsed: &T) -> SplitPaths<'_> {
SplitPaths { inner: os_imp::split_paths(unparsed.as_ref()) }
SplitPaths { inner: paths_imp::split_paths(unparsed.as_ref()) }
}

#[stable(feature = "env", since = "1.0.0")]
Expand Down Expand Up @@ -508,7 +508,7 @@ impl fmt::Debug for SplitPaths<'_> {
#[derive(Debug)]
#[stable(feature = "env", since = "1.0.0")]
pub struct JoinPathsError {
inner: os_imp::JoinPathsError,
inner: paths_imp::JoinPathsError,
}

/// Joins a collection of [`Path`]s appropriately for the `PATH`
Expand Down Expand Up @@ -579,7 +579,7 @@ where
I: IntoIterator<Item = T>,
T: AsRef<OsStr>,
{
os_imp::join_paths(paths.into_iter()).map_err(|e| JoinPathsError { inner: e })
paths_imp::join_paths(paths.into_iter()).map_err(|e| JoinPathsError { inner: e })
}

#[stable(feature = "env", since = "1.0.0")]
Expand Down Expand Up @@ -641,7 +641,7 @@ impl Error for JoinPathsError {
#[must_use]
#[stable(feature = "env", since = "1.0.0")]
pub fn home_dir() -> Option<PathBuf> {
os_imp::home_dir()
paths_imp::home_dir()
}

/// Returns the path of a temporary directory.
Expand Down Expand Up @@ -701,7 +701,7 @@ pub fn home_dir() -> Option<PathBuf> {
#[doc(alias = "GetTempPath", alias = "GetTempPath2")]
#[stable(feature = "env", since = "1.0.0")]
pub fn temp_dir() -> PathBuf {
os_imp::temp_dir()
paths_imp::temp_dir()
}

/// Returns the full filesystem path of the current running executable.
Expand Down Expand Up @@ -752,7 +752,7 @@ pub fn temp_dir() -> PathBuf {
/// ```
#[stable(feature = "env", since = "1.0.0")]
pub fn current_exe() -> io::Result<PathBuf> {
os_imp::current_exe()
paths_imp::current_exe()
}

/// An iterator over the arguments of a process, yielding a [`String`] value for
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/args/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ use crate::num::NonZero;
use crate::os::windows::prelude::*;
use crate::path::{Path, PathBuf};
use crate::sys::helpers::WStrUnits;
use crate::sys::pal::os::current_exe;
use crate::sys::pal::{ensure_no_nuls, fill_utf16_buf};
use crate::sys::path::get_long_path;
use crate::sys::paths::current_exe;
use crate::sys::{AsInner, c, to_u16s};
use crate::{io, iter, ptr};

Expand Down
3 changes: 3 additions & 0 deletions library/std/src/sys/io/error/windows.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use crate::sys::pal::{api, c};
use crate::{io, ptr};

#[cfg(test)]
mod tests;

pub fn errno() -> i32 {
api::get_last_error().code as i32
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::io::Error;
use crate::sys::c;
use crate::sys::pal::c;

// tests `error_string` above
#[test]
Expand Down
1 change: 1 addition & 0 deletions library/std/src/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub mod io;
pub mod net;
pub mod os_str;
pub mod path;
pub mod paths;
pub mod pipe;
pub mod platform_version;
pub mod process;
Expand Down
1 change: 0 additions & 1 deletion library/std/src/sys/pal/hermit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use crate::os::raw::c_char;
use crate::sys::env;

pub mod futex;
pub mod os;
pub mod time;

pub fn unsupported<T>() -> io::Result<T> {
Expand Down
57 changes: 0 additions & 57 deletions library/std/src/sys/pal/hermit/os.rs

This file was deleted.

2 changes: 0 additions & 2 deletions library/std/src/sys/pal/motor/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#![allow(unsafe_op_in_unsafe_fn)]

pub mod os;

pub use moto_rt::futex;

use crate::io;
Expand Down
64 changes: 0 additions & 64 deletions library/std/src/sys/pal/motor/os.rs

This file was deleted.

1 change: 0 additions & 1 deletion library/std/src/sys/pal/sgx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use crate::sync::atomic::{Atomic, AtomicBool, Ordering};

pub mod abi;
mod libunwind_integration;
pub mod os;
pub mod thread_parking;
pub mod waitqueue;

Expand Down
57 changes: 0 additions & 57 deletions library/std/src/sys/pal/sgx/os.rs

This file was deleted.

1 change: 0 additions & 1 deletion library/std/src/sys/pal/solid/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ pub mod itron {
// `error` is `pub(crate)` so that it can be accessed by `itron/error.rs` as
// `crate::sys::error`
pub(crate) mod error;
pub mod os;
pub use self::itron::thread_parking;

// SAFETY: must be called only once during runtime initialization.
Expand Down
56 changes: 0 additions & 56 deletions library/std/src/sys/pal/solid/os.rs

This file was deleted.

Loading
Loading