4 ms·
All destructors in Rust are also decided at runtime, fwiw. Even without any allocation or anything: let foo = Moves::new(); if condition { mem::drop(f
by Gankro 11y ago
All destructors in Rust are also decided at runtime, fwiw. Even without any allocation or anything:
let foo = Moves::new();
if condition { mem::drop(foo) }
// should foo be dropped here?
In practice many destructors can probably be scheduled statically at compile time.
- Manishearth 11y agoDynamic drop is something that will go away for all but the strange deferred-let case (It's not a language restriction). So that's okay.