Rollup merge of #124335 - ChrisDenton:stabilize-absolute, r=dtolnay

Stabilize `std::path::absolute`

FCP complete in https://github.com/rust-lang/rust/issues/92750#issuecomment-2075046985
This commit is contained in:
Matthias Krüger 2024-04-25 00:19:56 +02:00 committed by GitHub
commit ecf794bc69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 1 additions and 7 deletions

View File

@ -1,5 +1,3 @@
#![feature(absolute_path)]
use std::ffi::CString; use std::ffi::CString;
use std::fs; use std::fs;
use std::io; use std::io;

View File

@ -3332,7 +3332,6 @@ fn description(&self) -> &str {
/// ## Posix paths /// ## Posix paths
/// ///
/// ``` /// ```
/// #![feature(absolute_path)]
/// # #[cfg(unix)] /// # #[cfg(unix)]
/// fn main() -> std::io::Result<()> { /// fn main() -> std::io::Result<()> {
/// use std::path::{self, Path}; /// use std::path::{self, Path};
@ -3357,7 +3356,6 @@ fn description(&self) -> &str {
/// ## Windows paths /// ## Windows paths
/// ///
/// ``` /// ```
/// #![feature(absolute_path)]
/// # #[cfg(windows)] /// # #[cfg(windows)]
/// fn main() -> std::io::Result<()> { /// fn main() -> std::io::Result<()> {
/// use std::path::{self, Path}; /// use std::path::{self, Path};
@ -3382,7 +3380,7 @@ fn description(&self) -> &str {
/// ///
/// [posix-semantics]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13 /// [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 /// [windows-path]: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfullpathnamew
#[unstable(feature = "absolute_path", issue = "92750")] #[stable(feature = "absolute_path", since = "CURRENT_RUSTC_VERSION")]
pub fn absolute<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> { pub fn absolute<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
let path = path.as_ref(); let path = path.as_ref();
if path.as_os_str().is_empty() { if path.as_os_str().is_empty() {

View File

@ -12,7 +12,6 @@
#![feature(let_chains)] #![feature(let_chains)]
#![feature(lint_reasons)] #![feature(lint_reasons)]
#![feature(trait_upcasting)] #![feature(trait_upcasting)]
#![feature(absolute_path)]
// Configure clippy and other lints // Configure clippy and other lints
#![allow( #![allow(
clippy::collapsible_else_if, clippy::collapsible_else_if,

View File

@ -1,5 +1,4 @@
//@compile-flags: -Zmiri-disable-isolation //@compile-flags: -Zmiri-disable-isolation
#![feature(absolute_path)]
use std::path::{absolute, Path}; use std::path::{absolute, Path};
#[track_caller] #[track_caller]