mirror of https://github.com/rust-lang/rust.git
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).
This commit is contained in:
parent
53d3e6217b
commit
7f1518bddd
|
@ -740,6 +740,7 @@ impl AsRef<CStr> 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 {
|
||||
|
|
Loading…
Reference in New Issue