Added a warning to CString::into_raw too
This commit is contained in:
parent
00a7b56bab
commit
87abe174c4
1 changed files with 5 additions and 0 deletions
|
|
@ -446,6 +446,11 @@ impl CString {
|
|||
///
|
||||
/// Failure to call [`from_raw`] will lead to a memory leak.
|
||||
///
|
||||
/// The C side must **not** modify the length of the string (by writing a
|
||||
/// `NULL` somewhere inside the string or removing the final one) before
|
||||
/// it makes it back into Rust using [`from_raw`]. See the safety section
|
||||
/// in [`from_raw`].
|
||||
///
|
||||
/// [`from_raw`]: #method.from_raw
|
||||
///
|
||||
/// # Examples
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue