1
Fork 0
This commit is contained in:
Jan-Erik Rediger 2023-12-08 17:44:53 +01:00
parent 353250b058
commit 4bcf581a46

View file

@ -137,9 +137,9 @@ impl Drop for Object {
drop(obj);
// SAFETY:
// We took `ptr` and `len` from the vec earlier,
// then leaked it to get a stic reference to it which was only held within `self.inner`,
// which has been dropped above.
// We took `ptr` and `len` from the vec earlier (and ensured `len` == `cap`),
// then leaked it to get a static reference to it
// which was only held within `self.inner`, which has been dropped above.
unsafe {
let vec = Vec::from_raw_parts(self.ptr, self.len, self.len);
drop(vec);