We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e3d0b0 commit d58412bCopy full SHA for d58412b
src/librustrt/c_str.rs
@@ -123,7 +123,10 @@ impl CString {
123
}
124
125
/// Unwraps the wrapped `*libc::c_char` from the `CString` wrapper.
126
- /// Any ownership of the buffer by the `CString` wrapper is forgotten.
+ ///
127
+ /// The original object is destructed after this method is called, and if
128
+ /// the underlying pointer was previously allocated, care must be taken to
129
+ /// ensure that it is deallocated properly.
130
pub unsafe fn unwrap(self) -> *libc::c_char {
131
let mut c_str = self;
132
c_str.owns_buffer_ = false;
0 commit comments