Skip to content

Commit 0bbb878

Browse files
robertbastiangitbot
authored and
gitbot
committed
Update string.rs
1 parent 9d25fd4 commit 0bbb878

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

alloc/src/string.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -966,11 +966,8 @@ impl String {
966966
/// This is highly unsafe, due to the number of invariants that aren't
967967
/// checked:
968968
///
969-
/// * The memory at `buf` needs to have been previously allocated by the
970-
/// same allocator the standard library uses, with a required alignment of exactly 1.
971-
/// * `length` needs to be less than or equal to `capacity`.
972-
/// * `capacity` needs to be the correct value.
973-
/// * The first `length` bytes at `buf` need to be valid UTF-8.
969+
/// * all safety requirements for [`Vec::<u8>::from_raw_parts`]
970+
/// * all safety requirements for [`String::from_utf8_unchecked`]
974971
///
975972
/// Violating these may cause problems like corrupting the allocator's
976973
/// internal data structures. For example, it is normally **not** safe to

0 commit comments

Comments
 (0)