summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2023-05-17 11:13:56 +0530
committerGitHub <noreply@github.com>2023-05-17 11:13:56 +0530
commit5b58471c4c1d4dd4a87c5deccb3678c8357a0f40 (patch)
treec5128d271170c0c88103436719aaf3a9406baee3
parent2a5c4baf68ef935be5948c86934aa7519e663704 (diff)
parent5a0419352ce3b1eec3ea080dcb81d65409763054 (diff)
downloadrust-5b58471c4c1d4dd4a87c5deccb3678c8357a0f40.tar.gz
Rollup merge of #111043 - jmillikin:cstr-is-empty, r=dtolnay
Stabilize feature `cstr_is_empty` Fixes #102444 ACP: https://github.com/rust-lang/libs-team/issues/106
-rw-r--r--library/core/src/ffi/c_str.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/library/core/src/ffi/c_str.rs b/library/core/src/ffi/c_str.rs
index 07b11814f96..201bacb28c7 100644
--- a/library/core/src/ffi/c_str.rs
+++ b/library/core/src/ffi/c_str.rs
@@ -517,8 +517,6 @@ impl CStr {
/// # Examples
///
/// ```
- /// #![feature(cstr_is_empty)]
- ///
/// use std::ffi::CStr;
/// # use std::ffi::FromBytesWithNulError;
///
@@ -533,7 +531,8 @@ impl CStr {
/// # }
/// ```
#[inline]
- #[unstable(feature = "cstr_is_empty", issue = "102444")]
+ #[stable(feature = "cstr_is_empty", since = "CURRENT_RUSTC_VERSION")]
+ #[rustc_const_stable(feature = "cstr_is_empty", since = "CURRENT_RUSTC_VERSION")]
pub const fn is_empty(&self) -> bool {
// SAFETY: We know there is at least one byte; for empty strings it
// is the NUL terminator.