Skip to content

Commit de95117

Browse files
Inline CStr::from_bytes_with_nul_unchecked::rt_impl
1 parent 1603a70 commit de95117

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/core/src/ffi/c_str.rs

+1
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ impl CStr {
387387
#[rustc_const_stable(feature = "const_cstr_unchecked", since = "1.59.0")]
388388
#[rustc_allow_const_fn_unstable(const_eval_select)]
389389
pub const unsafe fn from_bytes_with_nul_unchecked(bytes: &[u8]) -> &CStr {
390+
#[inline]
390391
fn rt_impl(bytes: &[u8]) -> &CStr {
391392
// Chance at catching some UB at runtime with debug builds.
392393
debug_assert!(!bytes.is_empty() && bytes[bytes.len() - 1] == 0);

0 commit comments

Comments
 (0)