mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Fixed documentation within c_str::from_ptr
This commit is contained in:
parent
0b36e9dea3
commit
bdfab2049c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user