You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Interesting. I wrote ZeroDropDrop mostly as an exercise. In fact, I've no tests for ZeroDropDrop because I cannot currently imagine any use cases. If you want say a Vec to zero on drop, then you need either an allocator or a special data structure like cryptovec via #5 Anyways this sounds like enough reason to comment it out and put a warning. Thanks!
I had my fun with ZeroDropDrop but there is no reason for it.
Actually zeroing drop data requires an allocator or custom type.
And @bluss observed that this type might be even more dangeorus
than I initially thoguht :
#7
Drop
is not your usual trait. What does your bound do? It's probably not doing something sensible.The
Drop
trait is used to hang destructors on types. Other types can have destructors without implementing Drop.For example:
String
doesn't implement Drop, but it has a (structural) destructor that drops its fields (the Vec inside).Another famous type that doesn't implement
Drop
isBox<T>
...The text was updated successfully, but these errors were encountered: