Skip to content

Commit 81cc3af

Browse files
committed
Fix absolute issues
1 parent d59d32c commit 81cc3af

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

library/std/src/path.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3199,7 +3199,7 @@ impl Error for StripPrefixError {
31993199
/// # fn main() {}
32003200
/// ```
32013201
///
3202-
/// The paths is resolved using [POSIX semantics][posix-semantics] except that
3202+
/// The path is resolved using [POSIX semantics][posix-semantics] except that
32033203
/// it stops short of resolving symlinks. This means it will keep `..`
32043204
/// components and trailing slashes.
32053205
///
@@ -3231,7 +3231,7 @@ impl Error for StripPrefixError {
32313231
///
32323232
/// [posix-semantics]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13
32333233
/// [windows-path]: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfullpathnamew
3234-
#[unstable(feature = "absolute_path", issue = "none")]
3234+
#[unstable(feature = "absolute_path", issue = "92750")]
32353235
pub fn absolute<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
32363236
let path = path.as_ref();
32373237
if path.as_os_str().is_empty() {

library/std/src/sys/sgx/path.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use crate::ffi::OsStr;
2+
use crate::io;
23
use crate::path::{Path, PathBuf, Prefix};
34
use crate::sys::unsupported;
45

library/std/src/sys/solid/path.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use crate::ffi::OsStr;
2+
use crate::io;
23
use crate::path::{Path, PathBuf, Prefix};
34
use crate::sys::unsupported;
45

library/std/src/sys/unix/path.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::env;
22
use crate::ffi::OsStr;
33
use crate::io;
4-
use crate::os::unix::ffi::OsStrExt;
54
use crate::path::{Path, PathBuf, Prefix};
65

76
#[inline]
@@ -30,7 +29,7 @@ pub(crate) fn absolute(path: &Path) -> io::Result<PathBuf> {
3029
// https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13
3130

3231
let mut components = path.components();
33-
let path_os = path.as_os_str().as_bytes();
32+
let path_os = path.as_os_str().bytes();
3433

3534
let mut normalized = if path.is_absolute() {
3635
// "If a pathname begins with two successive <slash> characters, the

0 commit comments

Comments
 (0)