News for hackers. Stuff that matters.
Re:Announcing Rust 1.20 by steveklabnik on Thursday August 31, 2017 @05:24PM (#15144075)
> But I don't need destructors, or at least ones that can see these references, so it's frustrating.

If you bound it so that it only accepts Copy types, then you can know there are no destructors.

Re:Announcing Rust 1.20 by dbaupp on Thursday August 31, 2017 @07:20PM (#15144838)
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.
Re:Announcing Rust 1.20 by jeffdavis on Thursday August 31, 2017 @06:08PM (#15144372)
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.