Add another assertion without into_iter

This commit is contained in:
Jörn Horstmann 2022-03-25 16:57:59 +01:00
parent 4b53f563bd
commit d9a438dc73

View File

@ -1009,10 +1009,14 @@ fn test_into_iter_drop_allocator() {
} }
let mut drop_count = 0; let mut drop_count = 0;
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 allocator = ReferenceCountedAllocator(DropCounter { count: &mut drop_count });
let _ = Vec::<u32, _>::new_in(allocator).into_iter(); let _ = Vec::<u32, _>::new_in(allocator).into_iter();
assert_eq!(drop_count, 2);
assert_eq!(drop_count, 1);
} }
#[test] #[test]