Rollup merge of #64326 - hman523:master, r=joshtriplett

Fixed documentation within c_str::from_ptr

Fixed the documentation issue mentioned in #63590
This commit is contained in:
Mazdak Farrokhzad 2019-09-11 02:38:09 +02:00 committed by GitHub
commit 57df63ce7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -935,8 +935,10 @@ impl CStr {
/// Wraps a raw C string with a safe C string wrapper. /// Wraps a raw C string with a safe C string wrapper.
/// ///
/// This function will wrap the provided `ptr` with a `CStr` wrapper, which /// This function will wrap the provided `ptr` with a `CStr` wrapper, which
/// allows inspection and interoperation of non-owned C strings. This method /// allows inspection and interoperation of non-owned C strings. The total
/// is unsafe for a number of reasons: /// size of the raw C string must be smaller than `isize::MAX` **bytes**
/// in memory due to calling the `slice::from_raw_parts` function.
/// This method is unsafe for a number of reasons:
/// ///
/// * There is no guarantee to the validity of `ptr`. /// * There is no guarantee to the validity of `ptr`.
/// * The returned lifetime is not guaranteed to be the actual lifetime of /// * The returned lifetime is not guaranteed to be the actual lifetime of