From 0cf606177e79bc580fa27a82eb9c8b56e7253f46 Mon Sep 17 00:00:00 2001 From: Jörn Horstmann Date: Fri, 25 Mar 2022 11:39:11 +0100 Subject: Fix double drop of allocator in IntoIter impl of Vec --- library/alloc/src/vec/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'library/alloc/src/vec/mod.rs') diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 9a66e69bdc0..96857c4bd6f 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -2575,7 +2575,7 @@ impl IntoIterator for Vec { fn into_iter(self) -> IntoIter { unsafe { let mut me = ManuallyDrop::new(self); - let alloc = ptr::read(me.allocator()); + let alloc = ManuallyDrop::new(ptr::read(me.allocator())); let begin = me.as_mut_ptr(); let end = if mem::size_of::() == 0 { arith_offset(begin as *const i8, me.len() as isize) as *const T -- cgit 1.4.1-3-g733a5