@@ -282,7 +282,7 @@ impl CStr { |
|
|
282 |
282 |
pub const unsafe fn from_ptr<'a>(ptr: *const c_char) -> &'a CStr { |
283 |
283 |
// SAFETY: The caller has provided a pointer that points to a valid C |
284 |
284 |
// string with a NUL terminator less than `isize::MAX` from `ptr`. |
285 |
|
-let len = unsafe { const_strlen(ptr) }; |
|
285 |
+let len = unsafe { strlen(ptr) }; |
286 |
286 |
|
287 |
287 |
// SAFETY: The caller has provided a valid pointer with length less than |
288 |
288 |
// `isize::MAX`, so `from_raw_parts` is safe. The content remains valid |
@@ -743,7 +743,7 @@ impl AsRef for CStr { |
|
|
743 |
743 |
#[unstable(feature = "cstr_internals", issue = "none")] |
744 |
744 |
#[rustc_const_stable(feature = "const_cstr_from_ptr", since = "CURRENT_RUSTC_VERSION")] |
745 |
745 |
#[rustc_allow_const_fn_unstable(const_eval_select)] |
746 |
|
-const unsafe fn const_strlen(ptr: *const c_char) -> usize { |
|
746 |
+const unsafe fn strlen(ptr: *const c_char) -> usize { |
747 |
747 |
const fn strlen_ct(s: *const c_char) -> usize { |
748 |
748 |
let mut len = 0; |
749 |
749 |
|