From 45099e6cf6d44bb9cefdda42823794fab2df2703 Mon Sep 17 00:00:00 2001 From: Elichai Turkel Date: Wed, 26 May 2021 13:12:54 +0300 Subject: [PATCH] Add inline attr to private CString::into_inner --- library/std/src/ffi/c_str.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/std/src/ffi/c_str.rs b/library/std/src/ffi/c_str.rs index 2a4ef553be399..be7e099b73a24 100644 --- a/library/std/src/ffi/c_str.rs +++ b/library/std/src/ffi/c_str.rs @@ -672,6 +672,7 @@ impl CString { } /// Bypass "move out of struct which implements [`Drop`] trait" restriction. + #[inline] fn into_inner(self) -> Box<[u8]> { // Rationale: `mem::forget(self)` invalidates the previous call to `ptr::read(&self.inner)` // so we use `ManuallyDrop` to ensure `self` is not dropped.