Idea: Leak auto trait and Drop call guarantees

Yeah, it's for reasons like this that trying to say what sticks around in the face of leaks is difficult. I think the concession I'm dancing around is in actuality the exact operation described by Box::leak: if you don't drop a box then the data in the box will remain valid.

So here I'd be referring to any memory owned by the Drain, which is none. (If you want to get language lawyer-y, you could say that the function (stack) owns the memory that the Drain's "stack portion" is resident in.)

And yeah I know the <sup> trick, and in fact did exactly that elsewhen today, but sometimes writing posts on a smartphone makes me lazy :stuck_out_tongue:

1 Like