lens-vm / lens

Mozilla Public License 2.0
169 stars 5 forks source link

fix: Correctly manage module input buffer memory #61

Closed AndrewSisley closed 8 months ago

AndrewSisley commented 8 months ago

Relevant issue(s)

Resolves #60

Description

Correctly manages module input buffer memory.

mem::drop(foo) only drops the ManuallyDrop wrapper, it does not drop the underlying value. Was a new linter added in 1.71 to catch this and Keenan spotted it today: https://rust-lang.github.io/rust-clippy/rust-1.71.0/index.html#undropped_manually_drops.

Note: Use of mem::forget has also been removed, ManualDrop stuff is more descriptive and safer: https://doc.rust-lang.org/std/mem/fn.forget.html