1 A type with a `Drop` implementation was destructured when trying to initialize
4 Erroneous code example:
11 impl Drop for DropType {
19 static FOO: Foo = Foo { ..Foo { field1: DropType::A } }; // error!
22 The problem here is that if the given type or one of its fields implements the
23 `Drop` trait, this `Drop` implementation cannot be called during the static
24 type initialization which might cause a memory leak. To prevent this issue,
25 you need to instantiate all the static type's fields by hand.
32 impl Drop for DropType {
40 static FOO: Foo = Foo { field1: DropType::A }; // We initialize all fields