Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions library/alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,7 @@ impl<T, A: Allocator> Vec<T, A> {
/// v.push(3);
///
/// // Deconstruct the vector into parts.
/// let (p, len, cap, alloc) = v.into_parts_with_alloc();
/// let (p, len, cap, alloc) = v.into_parts_with_allocator();
///
/// unsafe {
/// // Overwrite memory with 4, 5, 6
Expand Down Expand Up @@ -1387,7 +1387,7 @@ impl<T, A: Allocator> Vec<T, A> {
/// v.push(0);
/// v.push(1);
///
/// let (ptr, len, cap, alloc) = v.into_parts_with_alloc();
/// let (ptr, len, cap, alloc) = v.into_parts_with_allocator();
///
/// let rebuilt = unsafe {
/// // We can now make changes to the components, such as
Expand All @@ -1401,7 +1401,7 @@ impl<T, A: Allocator> Vec<T, A> {
#[must_use = "losing the pointer will leak memory"]
#[unstable(feature = "allocator_api", issue = "32838")]
#[rustc_const_unstable(feature = "allocator_api", issue = "32838")]
pub const fn into_parts_with_alloc(self) -> (NonNull<T>, usize, usize, A) {
pub const fn into_parts_with_allocator(self) -> (NonNull<T>, usize, usize, A) {
let (ptr, len, capacity, alloc) = self.into_raw_parts_with_allocator();
// SAFETY: A `Vec` always has a non-null pointer.
(unsafe { NonNull::new_unchecked(ptr) }, len, capacity, alloc)
Expand Down Expand Up @@ -3512,7 +3512,7 @@ impl<T, A: Allocator> Vec<T, A> {
assert!(size_of::<T>() == size_of::<U>());
assert!(align_of::<T>() == align_of::<U>());
};
let (ptr, length, capacity, alloc) = self.into_parts_with_alloc();
let (ptr, length, capacity, alloc) = self.into_parts_with_allocator();
debug_assert_eq!(length, 0);
// SAFETY:
// - `ptr` and `alloc` were just returned from `self.into_raw_parts_with_allocator()`
Expand Down
Loading