We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 751aec8 + 9b1456e commit 57df63cCopy full SHA for 57df63c
src/libstd/ffi/c_str.rs
@@ -935,8 +935,10 @@ impl CStr {
935
/// Wraps a raw C string with a safe C string wrapper.
936
///
937
/// 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:
+ /// allows inspection and interoperation of non-owned C strings. The total
+ /// 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:
942
943
/// * There is no guarantee to the validity of `ptr`.
944
/// * The returned lifetime is not guaranteed to be the actual lifetime of
0 commit comments