1 A value with a custom `Drop` implementation may be dropped during const-eval.
3 Erroneous code example:
10 impl Drop for DropType {
18 static FOO: Foo = Foo { field1: (DropType::A, DropType::A).1 }; // error!
21 The problem here is that if the given type or one of its fields implements the
22 `Drop` trait, this `Drop` implementation cannot be called within a const
23 context since it may run arbitrary, non-const-checked code. To prevent this
24 issue, ensure all values with custom a custom `Drop` implementation escape the
32 impl Drop for DropType {
40 static FOO: Foo = Foo { field1: DropType::A }; // We initialize all fields