From 81cc3afe20d994d9c7cba4e75c3eed92bf98a402 Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Thu, 9 Dec 2021 14:31:22 +0000 Subject: [PATCH] Fix `absolute` issues --- library/std/src/path.rs | 4 ++-- library/std/src/sys/sgx/path.rs | 1 + library/std/src/sys/solid/path.rs | 1 + 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 dc5922c53bac..48502c0cd7c9 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -3199,7 +3199,7 @@ fn description(&self) -> &str { /// # 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 @@ fn description(&self) -> &str { /// /// [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>(path: P) -> io::Result { 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 9cfc61bf174f..c805c15e7024 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 ed532dc989b1..7045c9be25b0 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 1fdabab4598a..6d6f4c8b8dc6 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 { // 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 characters, the