Auto merge of #46581 - tmccombs:drain_filter_drop, r=sfackler

Add Drop impl for linked_list::DrainFilter

This is part of #43244. See https://github.com/rust-lang/rust/issues/43244#issuecomment-349894355
This commit is contained in:
bors 2017-12-09 09:54:55 +00:00
commit 6537fd184e

View File

@ -1071,6 +1071,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