From 949f0d63178e56781212ff8f74923b1d2ab93982 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 11 Jul 2024 20:12:43 -0700 Subject: [PATCH] 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). --- core/src/ffi/c_str.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/ffi/c_str.rs b/core/src/ffi/c_str.rs index f845dfc1fc413..dc2a5803a1b20 100644 --- a/core/src/ffi/c_str.rs +++ b/core/src/ffi/c_str.rs @@ -740,6 +740,7 @@ impl AsRef for CStr { /// The pointer must point to a valid buffer that contains a NUL terminator. The NUL must be /// located within `isize::MAX` from `ptr`. #[inline] +#[unstable(feature = "cstr_internals", issue = "none")] #[rustc_const_stable(feature = "const_cstr_from_ptr", since = "CURRENT_RUSTC_VERSION")] #[rustc_allow_const_fn_unstable(const_eval_select)] const unsafe fn const_strlen(ptr: *const c_char) -> usize {