From bdfab2049ce6bf67cb8557017d148960c534eb61 Mon Sep 17 00:00:00 2001 From: hman523 Date: Mon, 9 Sep 2019 18:50:11 -0500 Subject: [PATCH 1/2] Fixed documentation within c_str::from_ptr --- src/libstd/ffi/c_str.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index 65f4e0cafe0..29d86e7146e 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -935,8 +935,10 @@ impl CStr { /// Wraps a raw C string with a safe C string wrapper. /// /// This function will wrap the provided `ptr` with a `CStr` wrapper, which - /// allows inspection and interoperation of non-owned C strings. This method - /// is unsafe for a number of reasons: + /// allows inspection and interoperation of non-owned C strings. The total + /// 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`. /// * The returned lifetime is not guaranteed to be the actual lifetime of From 9b1456e4c5ebae855278ca6f5618915d6c7ad37e Mon Sep 17 00:00:00 2001 From: hman523 Date: Mon, 9 Sep 2019 20:09:17 -0500 Subject: [PATCH 2/2] Update added backticks around a function call Co-Authored-By: Mazdak Farrokhzad --- src/libstd/ffi/c_str.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index 29d86e7146e..bb346fb4db5 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -937,7 +937,7 @@ impl CStr { /// This function will wrap the provided `ptr` with a `CStr` wrapper, which /// allows inspection and interoperation of non-owned C strings. The total /// size of the raw C string must be smaller than `isize::MAX` **bytes** - /// in memory due to calling the slice::from_raw_parts function. + /// 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`.