Commit 44d8b4c8 authored by aticu's avatar aticu

Document UTF-8 validity of String::from_raw_parts

parent e7949bc2
......@@ -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.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment