Skip to content

Commit 06a2daf

Browse files
authored
Rollup merge of rust-lang#137992 - its-the-shrimp:stabilise_os_string_pathbuf_leak, r=dtolnay
Stabilise `os_string_pathbuf_leak` This PR stabilises `#[feature(os_string_pathbuf_leak)]`, which defines 2 new methods in the std: ```rs impl OsString { pub fn leak<'a>(self) -> &'a mut OsStr; } impl PathBuf { pub fn leak<'a>(self) -> &'a mut Path; } ``` ACP: rust-lang/libs-team#389 Tracking issue: rust-lang#125965 Implementation: rust-lang#125966
2 parents 775e0c8 + eba3a61 commit 06a2daf

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

library/std/src/ffi/os_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ impl OsString {
568568
/// However, keep in mind that trimming the capacity may result in a reallocation and copy.
569569
///
570570
/// [`into_boxed_os_str`]: Self::into_boxed_os_str
571-
#[unstable(feature = "os_string_pathbuf_leak", issue = "125965")]
571+
#[stable(feature = "os_string_pathbuf_leak", since = "CURRENT_RUSTC_VERSION")]
572572
#[inline]
573573
pub fn leak<'a>(self) -> &'a mut OsStr {
574574
OsStr::from_inner_mut(self.inner.leak())

library/std/src/path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ impl PathBuf {
12521252
/// However, keep in mind that trimming the capacity may result in a reallocation and copy.
12531253
///
12541254
/// [`into_boxed_path`]: Self::into_boxed_path
1255-
#[unstable(feature = "os_string_pathbuf_leak", issue = "125965")]
1255+
#[stable(feature = "os_string_pathbuf_leak", since = "CURRENT_RUSTC_VERSION")]
12561256
#[inline]
12571257
pub fn leak<'a>(self) -> &'a mut Path {
12581258
Path::from_inner_mut(self.inner.leak())

library/std/tests/path.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
path_add_extension,
44
path_file_prefix,
55
maybe_uninit_slice,
6-
os_string_pathbuf_leak,
76
normalize_lexically
87
)]
98

0 commit comments

Comments
 (0)