Document UTF-8 validity of String::from_raw_parts
This commit is contained in:
parent
e7949bc2f4
commit
44d8b4c8b1
@ -671,6 +671,7 @@ impl String {
|
||||
/// same allocator the standard library uses, with a required alignment of exactly 1.
|
||||
/// * `length` needs to be less than or equal to `capacity`.
|
||||
/// * `capacity` needs to be the correct value.
|
||||
/// * The first `length` bytes at `buf` need to be valid UTF-8.
|
||||
///
|
||||
/// Violating these may cause problems like corrupting the allocator's
|
||||
/// internal data structures.
|
||||
|
Loading…
Reference in New Issue
Block a user