Why "bring your own allocator" APIs are not more popular in Rust?

The problem with that is the problem with all linear types. The big one is how do you handle panics, since those unwind and call Drop::drop, if you have to consume the value.

Gankra's The Pain Of Real Linear Types In Rust should be mandatory reading for anyone wanting to add linear-esque types to Rust, and they should have a real purposeful answer (even if it's just "deal with the described fallout") to each of the issues described in that post.

9 Likes