diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 3c5db6723e960..b2946de2bcdad 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -1255,7 +1255,7 @@ impl Vec { /// 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 @@ -1387,7 +1387,7 @@ impl Vec { /// 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 @@ -1401,7 +1401,7 @@ impl Vec { #[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, usize, usize, A) { + pub const fn into_parts_with_allocator(self) -> (NonNull, 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) @@ -3512,7 +3512,7 @@ impl Vec { assert!(size_of::() == size_of::()); assert!(align_of::() == align_of::()); }; - 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()`