CString::from_raw should be document that changing the length of a string is UB #68456
Labels
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
A-FFI
Area: Foreign function interface (FFI)
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
Consider the following code:
Shortening the string from
CString::into_raw
and then passing it toCString::from_raw
will cause UB, but this is not documented in safety section of the documentation.The text was updated successfully, but these errors were encountered: