1 The `self` keyword was used inside of an associated function without a "`self`
4 Erroneous code example:
10 // `bar` is a method, because it has a receiver parameter.
13 // `foo` is not a method, because it has no receiver parameter.
15 self.bar(); // error: `self` value is a keyword only available in
16 // methods with a `self` parameter
21 The `self` keyword can only be used inside methods, which are associated
22 functions (functions defined inside of a `trait` or `impl` block) that have a
23 `self` receiver as its first parameter, like `self`, `&self`, `&mut self` or
24 `self: &mut Pin<Self>` (this last one is an example of an ["abitrary `self`
25 type"](https://github.com/rust-lang/rust/issues/44874)).
27 Check if the associated function's parameter list should have contained a `self`
28 receiver for it to be a method, and add it if so. Example:
36 fn foo(self) { // `foo` is now a method.