Skip to content

Commit

Permalink
Add another assertion without into_iter
Browse files Browse the repository at this point in the history
  • Loading branch information
jhorstmann committed Mar 25, 2022
1 parent 4b53f56 commit d9a438d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions library/alloc/tests/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit d9a438d

Please sign in to comment.