Drop
- for types that can be discarded triviallyDestruct
- for types that need cleanup when destroyed. Typically, any type that
contains
a Felt252Dict
must implement Destruct
, as the Felt252Dict
needs to be “squashed” when
going
out of scope to ensure a program is sound.Destruct
does not need to be implemented manually. It can be derived from the
Drop
and Destruct
implementations of the type’s fields.
Felt252Dict
and needs to be destructed: