about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-09-11 02:38:09 +0200
committerGitHub <noreply@github.com>2019-09-11 02:38:09 +0200
commit57df63ce7d6afe7fe3bfeb910f2346623fcfc36f (patch)
tree322f5a92912ece0cd18b3d434bd656b5f7eb3e69 /src/libstd
parent751aec8b475d8449b7dfb759ee0e9b45596933d9 (diff)
parent9b1456e4c5ebae855278ca6f5618915d6c7ad37e (diff)
downloadrust-57df63ce7d6afe7fe3bfeb910f2346623fcfc36f.tar.gz
rust-57df63ce7d6afe7fe3bfeb910f2346623fcfc36f.zip
Rollup merge of #64326 - hman523:master, r=joshtriplett
Fixed documentation within c_str::from_ptr

Fixed the documentation issue mentioned in #63590
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/ffi/c_str.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs
index 65f4e0cafe0..bb346fb4db5 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