mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-28 11:17:26 +03:00
Rollup merge of #145464 - Kivooeo:stabilize-const_pathbuf_osstring_new, r=ibraheemdev
Stabilize `const_pathbuf_osstring_new` feature This closes [tracking issue](https://github.com/rust-lang/rust/issues/141520) and stabilises `{OsString, PathBuf}::new` in const
This commit is contained in:
@@ -137,7 +137,7 @@ impl OsString {
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[must_use]
|
||||
#[inline]
|
||||
#[rustc_const_unstable(feature = "const_pathbuf_osstring_new", issue = "141520")]
|
||||
#[rustc_const_stable(feature = "const_pathbuf_osstring_new", since = "CURRENT_RUSTC_VERSION")]
|
||||
pub const fn new() -> OsString {
|
||||
OsString { inner: Buf::from_string(String::new()) }
|
||||
}
|
||||
|
||||
@@ -1191,7 +1191,7 @@ impl PathBuf {
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[must_use]
|
||||
#[inline]
|
||||
#[rustc_const_unstable(feature = "const_pathbuf_osstring_new", issue = "141520")]
|
||||
#[rustc_const_stable(feature = "const_pathbuf_osstring_new", since = "CURRENT_RUSTC_VERSION")]
|
||||
pub const fn new() -> PathBuf {
|
||||
PathBuf { inner: OsString::new() }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user