selfref 0.4.3

Semi-pain-free self-referential pinned types
Documentation
//! 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<Option<&'a Foo<'a>>>,
}

impl<'a> Drop for Foo<'a> {
    fn drop(&mut self) {
    }
}

struct FooKey;
opaque! {
    impl Opaque for FooKey {
        type Kind<'a> = Foo<'a>;
    }
}

fn main() {
}