Skip to content

lean leaks #12

Closed
Closed
@RalfJung

Description

@RalfJung

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions