Added a warning to CString::into_raw too

This commit is contained in:
Alexis Bourget 2020-06-03 23:55:41 +02:00
parent 00a7b56bab
commit 87abe174c4

View file

@ -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