From 74292bfd56cf7f4eedf6a6a02f93d8c3472b9d74 Mon Sep 17 00:00:00 2001 From: Nia Deckers Date: Wed, 19 Aug 2026 16:48:32 +0200 Subject: [PATCH] vec: fixup the name that i forgot --- library/alloc/src/vec/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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()`