+ /// Transfers ownership of the string to a C caller.
+ ///
+ /// The pointer must be returned to Rust and reconstituted using
+ /// `from_raw` to be properly deallocated. Specifically, one
+ /// should *not* use the standard C `free` function to deallocate
+ /// this string.
+ ///
+ /// Failure to call `from_raw` will lead to a memory leak.
+ #[unstable(feature = "cstr_memory2", reason = "recently added",
+ issue = "27769")]
+ #[deprecated(since = "1.4.0", reason = "renamed to into_raw")]
+ pub fn into_ptr(self) -> *const libc::c_char {
+ self.into_raw() as *const _
+ }
+