about summary refs log tree commit diff
path: root/library/std/src/ffi/os_str.rs
diff options
context:
space:
mode:
authorcyrgani <ansgar.w.zielke@gmail.com>2025-05-24 22:33:11 +0200
committercyrgani <ansgar.w.zielke@gmail.com>2025-05-24 22:33:11 +0200
commitfab206bf5852c532f85b9ad30f9eea8fc952e8e1 (patch)
tree855a3a240a04ac043d2767d69766c5a9e15301b1 /library/std/src/ffi/os_str.rs
parente88e85463468ce5d5ce468414eb69e3b15fa8d42 (diff)
downloadrust-fab206bf5852c532f85b9ad30f9eea8fc952e8e1.tar.gz
rust-fab206bf5852c532f85b9ad30f9eea8fc952e8e1.zip
make `OsString::new` and `PathBuf::new` unstably const
Diffstat (limited to 'library/std/src/ffi/os_str.rs')
-rw-r--r--library/std/src/ffi/os_str.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs
index ead48775127..22308224a2f 100644
--- a/library/std/src/ffi/os_str.rs
+++ b/library/std/src/ffi/os_str.rs
@@ -137,7 +137,8 @@ impl OsString {
     #[stable(feature = "rust1", since = "1.0.0")]
     #[must_use]
     #[inline]
-    pub fn new() -> OsString {
+    #[rustc_const_unstable(feature = "const_pathbuf_osstring_new", issue = "141520")]
+    pub const fn new() -> OsString {
         OsString { inner: Buf::from_string(String::new()) }
     }