Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 949f0d6

Browse files
committedJul 12, 2024
Add instability attribute on private const_strlen function
A `rustc_const_stable` attribute by itself has nonintuitive purpose when placed in a public module. Separately, it would probably be okay to rename `const_strlen` to just `strlen` to make it more clear this is our general-purpose implementation of strlen now, not something specifically for const (avoiding confusion like in PR 127444).
1 parent bcdc8e8 commit 949f0d6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
 

‎core/src/ffi/c_str.rs

+1
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,7 @@ impl AsRef<CStr> for CStr {
740740
/// The pointer must point to a valid buffer that contains a NUL terminator. The NUL must be
741741
/// located within `isize::MAX` from `ptr`.
742742
#[inline]
743+
#[unstable(feature = "cstr_internals", issue = "none")]
743744
#[rustc_const_stable(feature = "const_cstr_from_ptr", since = "CURRENT_RUSTC_VERSION")]
744745
#[rustc_allow_const_fn_unstable(const_eval_select)]
745746
const unsafe fn const_strlen(ptr: *const c_char) -> usize {

0 commit comments

Comments
 (0)
Failed to load comments.