-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add section about memory safety to ffi::CString
documentation
#31171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add section about memory safety to ffi::CString
documentation
#31171
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
/// | ||
/// # Safety | ||
/// | ||
/// CStrings are intended for working with traditional C-style strings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you put CString
is graves, both here and below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@steveklabnik: Fixed in 71b526b!
Also a minor language tweak to the documentation of the `ffi::CString::from_raw` function.
7fddeec
to
71b526b
Compare
@steveklabnik: Updated docs to have |
/// `into_raw`. The length of the string will be recalculated | ||
/// using the pointer. | ||
/// This should only ever be called with a pointer that was earlier | ||
/// obtained by calling `into_raw` on a CString. Additionally, the length |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one last CString
here, then we're good to go :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh jeez, I'm hopeless. 😞
@steveklabnik: Those last two backtick formatting nits are fixed in 9cfa191. |
@bors: r+ rollup Thanks! And no, you're not: I mess these things up all the time :) |
📌 Commit 9cfa191 has been approved by |
⌛ Testing commit 9cfa191 with merge 11e3113... |
💔 Test failed - auto-mac-64-nopt-t |
@bors: retry On Wed, Jan 27, 2016 at 11:06 PM, bors [email protected] wrote:
|
…eveklabnik Also a minor language tweak to the documentation of the `ffi::CString::from_raw` function.
Also a minor language tweak to the documentation of the
ffi::CString::from_raw
function.