We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a6741b0 + bc548d3 commit 2249c10Copy full SHA for 2249c10
tests/run-pass/btreemap.rs
@@ -1,4 +1,6 @@
1
+#![feature(btree_drain_filter)]
2
use std::collections::{BTreeMap, BTreeSet};
3
+use std::mem;
4
5
#[derive(PartialEq, Eq, PartialOrd, Ord)]
6
pub enum Foo {
@@ -43,4 +45,9 @@ pub fn main() {
43
45
b.insert(format!("key{}", i), i);
44
46
}
47
test_all_refs(&mut 13, b.values_mut());
48
+
49
+ // Test forgetting the drain.
50
+ let mut d = b.drain_filter(|_, i| *i < 30);
51
+ d.next().unwrap();
52
+ mem::forget(d);
53
0 commit comments