1 Drop was implemented on a trait, which is not allowed: only structs and
2 enums can implement Drop.
4 Erroneous code example:
9 impl Drop for MyTrait {
14 A workaround for this problem is to wrap the trait up in a struct, and implement
19 struct MyWrapper<T: MyTrait> { foo: T }
21 impl <T: MyTrait> Drop for MyWrapper<T> {
27 Alternatively, wrapping trait objects requires something:
32 //or Box<MyTrait>, if you wanted an owned trait object
33 struct MyWrapper<'a> { foo: &'a MyTrait }
35 impl <'a> Drop for MyWrapper<'a> {