about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--library/alloc/tests/vec.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/library/alloc/tests/vec.rs b/library/alloc/tests/vec.rs
index ab2414a6dc0..19e39ebf910 100644
--- a/library/alloc/tests/vec.rs
+++ b/library/alloc/tests/vec.rs
@@ -1009,10 +1009,14 @@ fn test_into_iter_drop_allocator() {
     }
 
     let mut drop_count = 0;
-    let allocator = ReferenceCountedAllocator(DropCounter { count: &mut drop_count });
-    let _ = Vec::<u32, _>::new_in(allocator).into_iter();
 
+    let allocator = ReferenceCountedAllocator(DropCounter { count: &mut drop_count });
+    let _ = Vec::<u32, _>::new_in(allocator);
     assert_eq!(drop_count, 1);
+
+    let allocator = ReferenceCountedAllocator(DropCounter { count: &mut drop_count });
+    let _ = Vec::<u32, _>::new_in(allocator).into_iter();
+    assert_eq!(drop_count, 2);
 }
 
 #[test]