Skip to content

Commit

Permalink
Document UTF-8 validity of String::from_raw_parts
Browse files Browse the repository at this point in the history
  • Loading branch information
aticu committed Jul 25, 2020
1 parent e7949bc commit 44d8b4c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/liballoc/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 44d8b4c

Please sign in to comment.