ecstatic-morse 4f3697b4b8
Rollup merge of #76150 - matklad:droporder, r=withoutboats
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,
}
```
2020-09-21 20:40:41 -07:00
..
2020-09-18 09:52:35 +02:00
2020-09-20 18:04:12 +02:00
2020-09-19 15:01:51 +00:00
2020-09-17 22:43:13 +02:00
2020-09-19 11:33:11 +02:00
2020-09-08 22:26:44 -04:00
2020-09-08 22:26:44 -04:00
2020-09-12 15:14:58 +02:00