Skip to content

Commit 89bcb77

Browse files
committed
Rollup merge of #28788 - tsurai:master, r=bluss
Please correct me if I confused something but the documentation for ```into_ptr``` and ```into_raw``` of ```CString``` seem to be swapped as the docs for ```into_ptr``` mentions ```into_raw``` and vice versa. Update: I actually meant ```into_ptr``` and ```into_raw``` NOT ```from_*```
2 parents 1f9fb33 + 25c2134 commit 89bcb77

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libstd/ffi/c_str.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ impl CString {
206206
/// Retakes ownership of a CString that was transferred to C.
207207
///
208208
/// The only appropriate argument is a pointer obtained by calling
209-
/// `into_ptr`. The length of the string will be recalculated
209+
/// `into_raw`. The length of the string will be recalculated
210210
/// using the pointer.
211211
#[unstable(feature = "cstr_memory2", reason = "recently added",
212212
issue = "27769")]
@@ -245,11 +245,11 @@ impl CString {
245245
/// Transfers ownership of the string to a C caller.
246246
///
247247
/// The pointer must be returned to Rust and reconstituted using
248-
/// `from_ptr` to be properly deallocated. Specifically, one
248+
/// `from_raw` to be properly deallocated. Specifically, one
249249
/// should *not* use the standard C `free` function to deallocate
250250
/// this string.
251251
///
252-
/// Failure to call `from_ptr` will lead to a memory leak.
252+
/// Failure to call `from_raw` will lead to a memory leak.
253253
#[stable(feature = "cstr_memory", since = "1.4.0")]
254254
pub fn into_raw(self) -> *mut libc::c_char {
255255
Box::into_raw(self.inner) as *mut libc::c_char

0 commit comments

Comments
 (0)