Skip to content

Commit 0ef49fe

Browse files
committed
Stabilize cstr_count_bytes
Newly stable API: ```rust impl CStr { pub fn count_bytes(&self) -> usize; } ``` Const stabilization has not yet been decided, so that will continue to be gated under <#113219>. Fixes: <#114441>
1 parent b234e44 commit 0ef49fe

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

library/core/src/ffi/c_str.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,6 @@ impl CStr {
517517
/// # Examples
518518
///
519519
/// ```
520-
/// #![feature(cstr_count_bytes)]
521-
///
522520
/// use std::ffi::CStr;
523521
///
524522
/// let cstr = CStr::from_bytes_with_nul(b"foo\0").unwrap();
@@ -530,7 +528,7 @@ impl CStr {
530528
#[inline]
531529
#[must_use]
532530
#[doc(alias("len", "strlen"))]
533-
#[unstable(feature = "cstr_count_bytes", issue = "114441")]
531+
#[stable(feature = "cstr_count_bytes", since = "CURRENT_RUSTC_VERSION")]
534532
#[rustc_const_unstable(feature = "const_cstr_from_ptr", issue = "113219")]
535533
pub const fn count_bytes(&self) -> usize {
536534
self.inner.len() - 1

0 commit comments

Comments
 (0)