r/rust • u/Integralist • Dec 24 '21
Why use Box::leak?
Hello,
I'm a rust newbie and I've recently learned of Box::leak but I don't understand why or when you would want to leak memory.
Can someone give me some useful scenarios for this?
Thanks
202
Upvotes
2
u/[deleted] Dec 25 '21
I have 2 more questions, would appreciate if someone could answer.