about summary refs log tree commit diff
path: root/library
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2023-01-28 17:06:30 -0500
committerTrevor Gross <tmgross@umich.edu>2023-02-01 02:14:07 -0500
commit83b05ef0ee05307143e2d04db401d6085f4759b9 (patch)
tree8ef7168a683cae7b6e515d047b0f65ffecc168c3 /library
parentad8e1dc2863f63c35ef3ceef3064d0851a1d2582 (diff)
Stabilize feature 'cstr_from_bytes_until_nul'
Diffstat (limited to 'library')
-rw-r--r--library/alloc/src/lib.rs1
-rw-r--r--library/core/src/error.rs2
-rw-r--r--library/core/src/ffi/c_str.rs10
-rw-r--r--library/std/src/lib.rs1
4 files changed, 5 insertions, 9 deletions
diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs
index 76dabfb429d..e9cc3875f68 100644
--- a/library/alloc/src/lib.rs
+++ b/library/alloc/src/lib.rs
@@ -116,7 +116,6 @@
 #![feature(const_eval_select)]
 #![feature(const_pin)]
 #![feature(const_waker)]
-#![feature(cstr_from_bytes_until_nul)]
 #![feature(dispatch_from_dyn)]
 #![feature(error_generic_member_access)]
 #![feature(error_in_core)]
diff --git a/library/core/src/error.rs b/library/core/src/error.rs
index d2fac23ff18..e11a5e99184 100644
--- a/library/core/src/error.rs
+++ b/library/core/src/error.rs
@@ -505,7 +505,7 @@ impl Error for crate::ffi::FromBytesWithNulError {
     }
 }
 
-#[unstable(feature = "cstr_from_bytes_until_nul", issue = "95027")]
+#[stable(feature = "cstr_from_bytes_until_nul", since = "CURRENT_RUSTC_VERSION")]
 impl Error for crate::ffi::FromBytesUntilNulError {}
 
 #[unstable(feature = "get_many_mut", issue = "104642")]
diff --git a/library/core/src/ffi/c_str.rs b/library/core/src/ffi/c_str.rs
index 15dd9ea7e80..288bac67f75 100644
--- a/library/core/src/ffi/c_str.rs
+++ b/library/core/src/ffi/c_str.rs
@@ -150,10 +150,10 @@ impl FromBytesWithNulError {
 /// This error is created by the [`CStr::from_bytes_until_nul`] method.
 ///
 #[derive(Clone, PartialEq, Eq, Debug)]
-#[unstable(feature = "cstr_from_bytes_until_nul", issue = "95027")]
+#[stable(feature = "cstr_from_bytes_until_nul", since = "CURRENT_RUSTC_VERSION")]
 pub struct FromBytesUntilNulError(());
 
-#[unstable(feature = "cstr_from_bytes_until_nul", issue = "95027")]
+#[stable(feature = "cstr_from_bytes_until_nul", since = "CURRENT_RUSTC_VERSION")]
 impl fmt::Display for FromBytesUntilNulError {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "data provided does not contain a nul")
@@ -306,8 +306,6 @@ impl CStr {
     ///
     /// # Examples
     /// ```
-    /// #![feature(cstr_from_bytes_until_nul)]
-    ///
     /// use std::ffi::CStr;
     ///
     /// let mut buffer = [0u8; 16];
@@ -322,8 +320,8 @@ impl CStr {
     /// assert_eq!(c_str.to_str().unwrap(), "AAAAAAAA");
     /// ```
     ///
-    #[unstable(feature = "cstr_from_bytes_until_nul", issue = "95027")]
-    #[rustc_const_unstable(feature = "cstr_from_bytes_until_nul", issue = "95027")]
+    #[stable(feature = "cstr_from_bytes_until_nul", since = "CURRENT_RUSTC_VERSION")]
+    #[rustc_const_unstable(feature = "const_cstr_from_bytes_until_nul", issue = "95027")]
     pub const fn from_bytes_until_nul(bytes: &[u8]) -> Result<&CStr, FromBytesUntilNulError> {
         let nul_pos = memchr::memchr(0, bytes);
         match nul_pos {
diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs
index 762f7a7c9a1..cd9f74820ae 100644
--- a/library/std/src/lib.rs
+++ b/library/std/src/lib.rs
@@ -278,7 +278,6 @@
 #![feature(char_error_internals)]
 #![feature(char_internals)]
 #![feature(core_intrinsics)]
-#![feature(cstr_from_bytes_until_nul)]
 #![feature(cstr_internals)]
 #![feature(duration_constants)]
 #![feature(error_generic_member_access)]