As discovered by Miri, the lean variant of beef leaks memory. I verified that by adding this patch
diff --git a/src/generic.rs b/src/generic.rs
index add1a9b..9fa0981 100644
--- a/src/generic.rs
+++ b/src/generic.rs
@@ -170,6 +170,7 @@ where
#[inline]
fn drop(&mut self) {
if let Some(capacity) = self.capacity() {
+ panic!("dropping!");
unsafe { T::owned_from_parts::<U>(self.inner, capacity) };
}
}
and then running cargo test lean. Clearly that should drop the contents and thus panic at some point, but it does not.
As discovered by Miri, the
leanvariant of beef leaks memory. I verified that by adding this patchand then running
cargo test lean. Clearly that should drop the contents and thus panic at some point, but it does not.