use std::{ ops::Deref, }; struct Ptr(Box); impl Deref for Ptr { type Target = T; fn deref(&self) -> &T { &*self.0 } } trait Foo { fn foo(self: Ptr); //~ ERROR `Ptr` cannot be used as the type of `self` without } struct Bar; impl Foo for Bar { fn foo(self: Ptr) {} //~ ERROR `Ptr` cannot be used as the type of `self` without } impl Bar { fn bar(self: Box>) {} //~ ERROR `Box>` cannot be used as the } fn main() {}