#![cfg(feature = "nightly")] #![feature(arbitrary_self_types)] use gc::{Finalize, Gc, Trace}; trait Foo: Trace { fn foo(self: Gc); } #[derive(Trace, Finalize)] struct Bar; impl Foo for Bar { fn foo(self: Gc) {} } #[test] fn gc_self_method() { let gc: Gc = Gc::new(Bar); gc.foo(); }