From 9f6a9afe92df4b43dbf25fd43c48baec7659c4b2 Mon Sep 17 00:00:00 2001 From: Michael Hall Date: Thu, 15 Aug 2024 14:26:01 +1000 Subject: [PATCH 1/3] stabilize std::path::file_prefix --- library/std/src/path.rs | 3 +-- tests/run-make/cross-lang-lto/rmake.rs | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/library/std/src/path.rs b/library/std/src/path.rs index 80163667636ae..43706404ae099 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -2573,7 +2573,6 @@ impl Path { /// # Examples /// /// ``` - /// # #![feature(path_file_prefix)] /// use std::path::Path; /// /// assert_eq!("foo", Path::new("foo.rs").file_prefix().unwrap()); @@ -2586,7 +2585,7 @@ impl Path { /// /// [`Path::file_stem`]: Path::file_stem /// - #[unstable(feature = "path_file_prefix", issue = "86319")] + #[stable(feature = "path_file_prefix", since = "1.80.1")] #[must_use] pub fn file_prefix(&self) -> Option<&OsStr> { self.file_name().map(split_file_at_dot).and_then(|(before, _after)| Some(before)) diff --git a/tests/run-make/cross-lang-lto/rmake.rs b/tests/run-make/cross-lang-lto/rmake.rs index dc376b561e43e..7ab8b48245db7 100644 --- a/tests/run-make/cross-lang-lto/rmake.rs +++ b/tests/run-make/cross-lang-lto/rmake.rs @@ -3,8 +3,6 @@ // -Clinker-plugin-lto. // See https://github.com/rust-lang/rust/pull/50000 -#![feature(path_file_prefix)] - use std::path::PathBuf; use run_make_support::{ From cd3e63e71f17360b6666007a400e1b44c32bad40 Mon Sep 17 00:00:00 2001 From: Michael Hall Date: Thu, 15 Aug 2024 14:50:06 +1000 Subject: [PATCH 2/3] remove missed feature gate --- src/tools/clippy/tests/missing-test-files.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tools/clippy/tests/missing-test-files.rs b/src/tools/clippy/tests/missing-test-files.rs index a8225d037e828..fa82b4131254b 100644 --- a/src/tools/clippy/tests/missing-test-files.rs +++ b/src/tools/clippy/tests/missing-test-files.rs @@ -1,6 +1,5 @@ #![warn(rust_2018_idioms, unused_lifetimes)] #![allow(clippy::assertions_on_constants)] -#![feature(path_file_prefix)] use std::cmp::Ordering; use std::ffi::OsStr; From cd791f6e4fdb196dcd64021b05099f51b4e994dd Mon Sep 17 00:00:00 2001 From: Michael Hall Date: Thu, 15 Aug 2024 20:09:32 +1000 Subject: [PATCH 3/3] Update library/std/src/path.rs Co-authored-by: Slanterns --- library/std/src/path.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/path.rs b/library/std/src/path.rs index 43706404ae099..881e2f57cefc4 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -2585,7 +2585,7 @@ impl Path { /// /// [`Path::file_stem`]: Path::file_stem /// - #[stable(feature = "path_file_prefix", since = "1.80.1")] + #[stable(feature = "path_file_prefix", since = "CURRENT_RUSTC_VERSION")] #[must_use] pub fn file_prefix(&self) -> Option<&OsStr> { self.file_name().map(split_file_at_dot).and_then(|(before, _after)| Some(before))