diff options
| author | Konrad Borowski <konrad@borowski.pw> | 2022-08-10 12:21:17 +0000 |
|---|---|---|
| committer | Konrad Borowski <konrad@borowski.pw> | 2022-08-10 12:21:17 +0000 |
| commit | de95117ea8480ad6f5be175de8a1348b09970153 (patch) | |
| tree | 035a9ed1edc48c73f7e1562f9cff1365e6181496 | |
| parent | 1603a70f82240ba2d27f72f964e36614d7620ad3 (diff) | |
| download | rust-de95117ea8480ad6f5be175de8a1348b09970153.tar.gz rust-de95117ea8480ad6f5be175de8a1348b09970153.zip | |
Inline CStr::from_bytes_with_nul_unchecked::rt_impl
| -rw-r--r-- | library/core/src/ffi/c_str.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/library/core/src/ffi/c_str.rs b/library/core/src/ffi/c_str.rs index 82e63a7fe1d..d8b8ac4d871 100644 --- a/library/core/src/ffi/c_str.rs +++ b/library/core/src/ffi/c_str.rs @@ -387,6 +387,7 @@ impl CStr { #[rustc_const_stable(feature = "const_cstr_unchecked", since = "1.59.0")] #[rustc_allow_const_fn_unstable(const_eval_select)] pub const unsafe fn from_bytes_with_nul_unchecked(bytes: &[u8]) -> &CStr { + #[inline] fn rt_impl(bytes: &[u8]) -> &CStr { // Chance at catching some UB at runtime with debug builds. debug_assert!(!bytes.is_empty() && bytes[bytes.len() - 1] == 0); |
