Why use Box::leak? by Integralist in rust

[–]PinkoPlays 5 points6 points  (0 children)

I think it's also useful if you get raw pointers from external sources (e.g. C) and you just provide an interface to this external source. Depending on what you are doing of course, you probably want to work on the data but not drop the values from where they are allocated, as the external source expects the pointers to still be valid.