The tree itself will need destructors to clean up allocations, and that's what's problematic here: if the tree is destroyed top down, the destructor of the children may access the parent which has already been invalidated, and similarly destroying bottom up risks the destructor of the parent accessing the children.
Interesting. Then rust should not care about the destruction order, right?
Re:Announcing Rust 1.20
by steveklabnik on Thursday August 31, 2017 @06:53PM
(#15144668)
For this purpose, no, I don't think. That said I might be missing something and maybe th compiler doesn't understand this, so I'm not saying it's a panacea in your case, just might be worth looking at.
If you bound it so that it only accepts Copy types, then you can know there are no destructors.