about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2025-08-13 07:03:47 +0200
committerGitHub <noreply@github.com>2025-08-13 07:03:47 +0200
commitff44871be5b5bd6027c4956eb6d4520e87974c1e (patch)
treebb8de6ddeb236d164e628162ba70e331e12f1921
parent900e568026f63e0ba88e1db71c6347f628186cfc (diff)
parent4c4b8b23c6935e719ca01b614922024abb694656 (diff)
downloadrust-ff44871be5b5bd6027c4956eb6d4520e87974c1e.tar.gz
rust-ff44871be5b5bd6027c4956eb6d4520e87974c1e.zip
Rollup merge of #144870 - Kivooeo:file_prefix-stabilize, r=tgross35
Stabilize `path_file_prefix` feature

This stabilises `Path::file_prefix`, following the FCP in [tracking issue ](https://github.com/rust-lang/rust/issues/86319)

(FCP ended almost a year ago, so if it's needed for proccess we could rerun it)

Closes: https://github.com/rust-lang/rust/issues/86319
-rw-r--r--library/std/src/path.rs3
-rw-r--r--library/std/tests/path.rs8
-rw-r--r--src/tools/clippy/tests/missing-test-files.rs2
3 files changed, 3 insertions, 10 deletions
diff --git a/library/std/src/path.rs b/library/std/src/path.rs
index e7ba6936435..3b52804d6be 100644
--- a/library/std/src/path.rs
+++ b/library/std/src/path.rs
@@ -2678,7 +2678,6 @@ impl Path {
     /// # Examples
     ///
     /// ```
-    /// # #![feature(path_file_prefix)]
     /// use std::path::Path;
     ///
     /// assert_eq!("foo", Path::new("foo.rs").file_prefix().unwrap());
@@ -2693,7 +2692,7 @@ impl Path {
     ///
     /// [`Path::file_stem`]: Path::file_stem
     ///
-    #[unstable(feature = "path_file_prefix", issue = "86319")]
+    #[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))
diff --git a/library/std/tests/path.rs b/library/std/tests/path.rs
index 901d2770f20..e1576a0d423 100644
--- a/library/std/tests/path.rs
+++ b/library/std/tests/path.rs
@@ -1,10 +1,4 @@
-#![feature(
-    clone_to_uninit,
-    path_add_extension,
-    path_file_prefix,
-    maybe_uninit_slice,
-    normalize_lexically
-)]
+#![feature(clone_to_uninit, path_add_extension, maybe_uninit_slice, normalize_lexically)]
 
 use std::clone::CloneToUninit;
 use std::ffi::OsStr;
diff --git a/src/tools/clippy/tests/missing-test-files.rs b/src/tools/clippy/tests/missing-test-files.rs
index 565dcd73f58..63f960c92fa 100644
--- a/src/tools/clippy/tests/missing-test-files.rs
+++ b/src/tools/clippy/tests/missing-test-files.rs
@@ -1,6 +1,6 @@
 #![warn(rust_2018_idioms, unused_lifetimes)]
 #![allow(clippy::assertions_on_constants)]
-#![feature(path_file_prefix)]
+#![cfg_attr(bootstrap, feature(path_file_prefix))]
 
 use std::cmp::Ordering;
 use std::ffi::OsStr;