//! Example of how `opaque!` prevents unsound `Drop`. //! //! NOTE: Also in trait `Opaque` documentation. Keep 'em in sync. use std::cell::Cell; use selfref::opaque; struct Foo<'a> { foo: Cell>>, } impl<'a> Drop for Foo<'a> { fn drop(&mut self) { } } struct FooKey; opaque! { impl Opaque for FooKey { type Kind<'a> = Foo<'a>; } } fn main() { }