Skip to content

Commit e7949bc

Browse files
committed
Fix wrong name in String::from_raw_parts docs
1 parent 0e11fc8 commit e7949bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/liballoc/string.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -667,15 +667,15 @@ impl String {
667667
/// This is highly unsafe, due to the number of invariants that aren't
668668
/// checked:
669669
///
670-
/// * The memory at `ptr` needs to have been previously allocated by the
670+
/// * The memory at `buf` needs to have been previously allocated by the
671671
/// same allocator the standard library uses, with a required alignment of exactly 1.
672672
/// * `length` needs to be less than or equal to `capacity`.
673673
/// * `capacity` needs to be the correct value.
674674
///
675675
/// Violating these may cause problems like corrupting the allocator's
676676
/// internal data structures.
677677
///
678-
/// The ownership of `ptr` is effectively transferred to the
678+
/// The ownership of `buf` is effectively transferred to the
679679
/// `String` which may then deallocate, reallocate or change the
680680
/// contents of memory pointed to by the pointer at will. Ensure
681681
/// that nothing else uses the pointer after calling this

0 commit comments

Comments
 (0)