Skip to content

Commit

Permalink
Rollup merge of #48507 - GuillaumeGomez:cstr-note, r=steveklabnik
Browse files Browse the repository at this point in the history
Add new warning for CStr::from_ptr

Fixes #48401.
  • Loading branch information
kennytm committed Mar 6, 2018
2 parents ee94252 + 5344b07 commit ebc6d6e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libstd/ffi/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,8 @@ impl CStr {
/// `ptr`.
/// * There is no guarantee that the memory pointed to by `ptr` contains a
/// valid nul terminator byte at the end of the string.
/// * It is not guaranteed that the memory pointed by `ptr` won't change
/// before the `CStr` has been destroyed.
///
/// > **Note**: This operation is intended to be a 0-cost cast but it is
/// > currently implemented with an up-front calculation of the length of
Expand Down

0 comments on commit ebc6d6e

Please sign in to comment.