diff options
| author | Jörn Horstmann <git@jhorstmann.net> | 2022-03-25 16:57:59 +0100 |
|---|---|---|
| committer | Jörn Horstmann <git@jhorstmann.net> | 2022-03-25 16:57:59 +0100 |
| commit | d9a438dc73de6ff146ae3e6bc4050b7cea41b09e (patch) | |
| tree | d22c9a01c408c2091e6a43474a23e820b0a4bc71 /library | |
| parent | 4b53f563bd5b0f0e9cad26dbf2514f9a72c3fa2f (diff) | |
| download | rust-d9a438dc73de6ff146ae3e6bc4050b7cea41b09e.tar.gz rust-d9a438dc73de6ff146ae3e6bc4050b7cea41b09e.zip | |
Add another assertion without into_iter
Diffstat (limited to 'library')
| -rw-r--r-- | library/alloc/tests/vec.rs | 8 |
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] |
