#![allow(dead_code, deprecated, unused_variables, unused_mut)] use std::boxed::Box; use std::rc::Rc; struct MyContainedType; fn main() { let t = Rc::new(Box::new(MyContainedType)); t.method_a(); t.method_b(); t.method_c(); } impl MyContainedType { fn method_a(&self) {} fn method_b(self: &Box) {} fn method_c(self: &Rc>) {} }