Skip to content

Commit d7d5be0

Browse files
authored
Rollup merge of #123661 - tgross35:stabilize-cstr_count_bytes, r=dtolnay
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>. FCP finished at #114441 (comment). Fixes: <#114441>
2 parents 084d27b + 0ef49fe commit d7d5be0

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)