What types are valid for the `self` parameter of a method?
Before Rust 1.33, there are only four valid method receivers: struct Foo; impl Foo { fn by_val(self: Foo) {} // a.k.a. by_val(self) fn by_ref(self: &Foo) {} // a.k.a. by_ref(&self) fn by_mut_ref(self: &mut Foo) {} // a.k.a. by_mut_ref(&mut self) fn by_box(self: Box<Foo>) {} // no short form } fn main() {} Originally, Rust didn’t have this … Read more