Skip to content

Commit

Permalink
Auto merge of #1543 - RalfJung:btree, r=RalfJung
Browse files Browse the repository at this point in the history
test BTreeMap::drain_filter for leaks
  • Loading branch information
bors committed Sep 11, 2020
2 parents a6741b0 + bc548d3 commit 2249c10
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/run-pass/btreemap.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#![feature(btree_drain_filter)]
use std::collections::{BTreeMap, BTreeSet};
use std::mem;

#[derive(PartialEq, Eq, PartialOrd, Ord)]
pub enum Foo {
Expand Down Expand Up @@ -43,4 +45,9 @@ pub fn main() {
b.insert(format!("key{}", i), i);
}
test_all_refs(&mut 13, b.values_mut());

// Test forgetting the drain.
let mut d = b.drain_filter(|_, i| *i < 30);
d.next().unwrap();
mem::forget(d);
}

0 comments on commit 2249c10

Please sign in to comment.