4f3697b4b8
Don't recommend ManuallyDrop to customize drop order See https://internals.rust-lang.org/t/need-for-controlling-drop-order-of-fields/12914/21 for the discussion. TL;DR: ManuallyDrop is unsafe and footguny, but you can just ask the compiler to do all the work for you by re-ordering declarations. Specifically, the original example from the docs is much better written as ```rust struct Peach; struct Banana; struct Melon; struct FruitBox { melon: Melon, // XXX: mind the relative drop order of the fields below peach: Peach, banana: Banana, } ``` |
||
---|---|---|
.. | ||
alloc | ||
backtrace@4083a90168 | ||
core | ||
panic_abort | ||
panic_unwind | ||
proc_macro | ||
profiler_builtins | ||
rtstartup | ||
rustc-std-workspace-alloc | ||
rustc-std-workspace-core | ||
rustc-std-workspace-std | ||
std | ||
stdarch@718175b34a | ||
term | ||
test | ||
unwind |