Skip to content

Commit 57df63c

Browse files
authoredSep 11, 2019
Rollup merge of #64326 - hman523:master, r=joshtriplett
Fixed documentation within c_str::from_ptr Fixed the documentation issue mentioned in #63590
2 parents 751aec8 + 9b1456e commit 57df63c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/libstd/ffi/c_str.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -935,8 +935,10 @@ impl CStr {
935935
/// Wraps a raw C string with a safe C string wrapper.
936936
///
937937
/// This function will wrap the provided `ptr` with a `CStr` wrapper, which
938-
/// allows inspection and interoperation of non-owned C strings. This method
939-
/// is unsafe for a number of reasons:
938+
/// allows inspection and interoperation of non-owned C strings. The total
939+
/// size of the raw C string must be smaller than `isize::MAX` **bytes**
940+
/// in memory due to calling the `slice::from_raw_parts` function.
941+
/// This method is unsafe for a number of reasons:
940942
///
941943
/// * There is no guarantee to the validity of `ptr`.
942944
/// * The returned lifetime is not guaranteed to be the actual lifetime of

0 commit comments

Comments
 (0)
Please sign in to comment.