diff options
| author | Jörn Horstmann <git@jhorstmann.net> | 2022-03-25 11:39:11 +0100 |
|---|---|---|
| committer | Jörn Horstmann <git@jhorstmann.net> | 2022-03-25 11:39:11 +0100 |
| commit | 0cf606177e79bc580fa27a82eb9c8b56e7253f46 (patch) | |
| tree | efb749595e7d47f322a3f86398e17e98f9f7f654 /library/alloc/src/vec/mod.rs | |
| parent | 4ce257ff198d23bdf14e956fbf2fe0fed297201f (diff) | |
| download | rust-0cf606177e79bc580fa27a82eb9c8b56e7253f46.tar.gz rust-0cf606177e79bc580fa27a82eb9c8b56e7253f46.zip | |
Fix double drop of allocator in IntoIter impl of Vec
Diffstat (limited to 'library/alloc/src/vec/mod.rs')
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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<T, A: Allocator> IntoIterator for Vec<T, A> { fn into_iter(self) -> IntoIter<T, A> { 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::<T>() == 0 { arith_offset(begin as *const i8, me.len() as isize) as *const T |
