mirror of
https://github.com/rust-lang/rust
synced 2024-10-16 13:34:56 +00:00
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
This commit is contained in:
commit
5b58471c4c
|
@ -517,8 +517,6 @@ pub const fn as_ptr(&self) -> *const c_char {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(cstr_is_empty)]
|
||||
///
|
||||
/// use std::ffi::CStr;
|
||||
/// # use std::ffi::FromBytesWithNulError;
|
||||
///
|
||||
|
@ -533,7 +531,8 @@ pub const fn as_ptr(&self) -> *const c_char {
|
|||
/// # }
|
||||
/// ```
|
||||
#[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.
|
||||
|
|
Loading…
Reference in a new issue