rust-lang / nomicon

The Dark Arts of Advanced and Unsafe Rust Programming
https://doc.rust-lang.org/nomicon/
Apache License 2.0
1.75k stars 256 forks source link

clarify what is leaked even more #369

Open gftea opened 2 years ago

gftea commented 2 years ago

it says below in https://github.com/rust-lang/nomicon/blob/master/src/leaking.md

all that does is leak even more (and possibly leave the Vec in an unexpected but otherwise consistent state).

As I understand, the remaining items in vec is leaked due to mem::forget(drainer), What is leaked even more in the example?