mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Add inline attr to private CString::into_inner
This commit is contained in:
parent
cdbe288897
commit
45099e6cf6
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user