diff options
| author | Chris Denton <christophersdenton@gmail.com> | 2021-12-09 14:31:22 +0000 |
|---|---|---|
| committer | Chris Denton <christophersdenton@gmail.com> | 2022-02-08 14:57:35 +0000 |
| commit | 81cc3afe20d994d9c7cba4e75c3eed92bf98a402 (patch) | |
| tree | e051c834d7ac56c79e46fc8dc06575f70eb77acc /library/std/src | |
| parent | d59d32c4f11ce35a4969f9136942b97074b35168 (diff) | |
| download | rust-81cc3afe20d994d9c7cba4e75c3eed92bf98a402.tar.gz rust-81cc3afe20d994d9c7cba4e75c3eed92bf98a402.zip | |
Fix `absolute` issues
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/path.rs | 4 | ||||
| -rw-r--r-- | library/std/src/sys/sgx/path.rs | 1 | ||||
| -rw-r--r-- | library/std/src/sys/solid/path.rs | 1 | ||||
| -rw-r--r-- | library/std/src/sys/unix/path.rs | 3 |
4 files changed, 5 insertions, 4 deletions
diff --git a/library/std/src/path.rs b/library/std/src/path.rs index dc5922c53ba..48502c0cd7c 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -3199,7 +3199,7 @@ impl Error for StripPrefixError { /// # fn main() {} /// ``` /// -/// The paths is resolved using [POSIX semantics][posix-semantics] except that +/// The path is resolved using [POSIX semantics][posix-semantics] except that /// it stops short of resolving symlinks. This means it will keep `..` /// components and trailing slashes. /// @@ -3231,7 +3231,7 @@ impl Error for StripPrefixError { /// /// [posix-semantics]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13 /// [windows-path]: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfullpathnamew -#[unstable(feature = "absolute_path", issue = "none")] +#[unstable(feature = "absolute_path", issue = "92750")] pub fn absolute<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> { let path = path.as_ref(); if path.as_os_str().is_empty() { diff --git a/library/std/src/sys/sgx/path.rs b/library/std/src/sys/sgx/path.rs index 9cfc61bf174..c805c15e702 100644 --- a/library/std/src/sys/sgx/path.rs +++ b/library/std/src/sys/sgx/path.rs @@ -1,4 +1,5 @@ use crate::ffi::OsStr; +use crate::io; use crate::path::{Path, PathBuf, Prefix}; use crate::sys::unsupported; diff --git a/library/std/src/sys/solid/path.rs b/library/std/src/sys/solid/path.rs index ed532dc989b..7045c9be25b 100644 --- a/library/std/src/sys/solid/path.rs +++ b/library/std/src/sys/solid/path.rs @@ -1,4 +1,5 @@ use crate::ffi::OsStr; +use crate::io; use crate::path::{Path, PathBuf, Prefix}; use crate::sys::unsupported; diff --git a/library/std/src/sys/unix/path.rs b/library/std/src/sys/unix/path.rs index 1fdabab4598..6d6f4c8b8dc 100644 --- a/library/std/src/sys/unix/path.rs +++ b/library/std/src/sys/unix/path.rs @@ -1,7 +1,6 @@ use crate::env; use crate::ffi::OsStr; use crate::io; -use crate::os::unix::ffi::OsStrExt; use crate::path::{Path, PathBuf, Prefix}; #[inline] @@ -30,7 +29,7 @@ pub(crate) fn absolute(path: &Path) -> io::Result<PathBuf> { // https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13 let mut components = path.components(); - let path_os = path.as_os_str().as_bytes(); + let path_os = path.as_os_str().bytes(); let mut normalized = if path.is_absolute() { // "If a pathname begins with two successive <slash> characters, the |
