about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorThayne McCombs <astrothayne@gmail.com>2017-12-07 22:20:25 -0700
committerThayne McCombs <astrothayne@gmail.com>2017-12-07 22:20:25 -0700
commit37335d3f43cc04346e4f6357c1da3d826ddbbb3c (patch)
tree963452e3a9e3a613edc1e757e9beab7fdb14ef8e /src/liballoc
parentc8ddf28527119a06a9f5da9bd34c97ae97afe531 (diff)
downloadrust-37335d3f43cc04346e4f6357c1da3d826ddbbb3c.tar.gz
rust-37335d3f43cc04346e4f6357c1da3d826ddbbb3c.zip
Add Drop impl for linked_list::DrainFilter
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/linked_list.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/liballoc/linked_list.rs b/src/liballoc/linked_list.rs
index 0fe3c972422..3ac5a85d721 100644
--- a/src/liballoc/linked_list.rs
+++ b/src/liballoc/linked_list.rs
@@ -1072,6 +1072,15 @@ impl<'a, T, F> Iterator for DrainFilter<'a, T, F>
 }
 
 #[unstable(feature = "drain_filter", reason = "recently added", issue = "43244")]
+impl<'a, T, F> Drop for DrainFilter<'a, T, F>
+    where F: FnMut(&mut T) -> bool,
+{
+    fn drop(&mut self) {
+        for _ in self { }
+    }
+}
+
+#[unstable(feature = "drain_filter", reason = "recently added", issue = "43244")]
 impl<'a, T: 'a + fmt::Debug, F> fmt::Debug for DrainFilter<'a, T, F>
     where F: FnMut(&mut T) -> bool
 {