The code above fails to compile with the error below:
error[E0307]: invalid `self` parameter type: usize
--> src/lib.rs:4:20
|
4 | pub fn f(self: usize) {}
| ^^^^^
|
= note: type of `self` must be `Self` or a type that dereferences to it
= help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
I didn't know either, so I pretty much just asked the compiler. I love rustc so much