Error code E0424
The self
keyword was used inside of an associated function without a "self
receiver" parameter.
Erroneous code example:
ⓘ
The self
keyword can only be used inside methods, which are associated
functions (functions defined inside of a trait
or impl
block) that have a
self
receiver as its first parameter, like self
, &self
, &mut self
or
self: &mut Pin<Self>
(this last one is an example of an "arbitrary self
type").
Check if the associated function's parameter list should have contained a self
receiver for it to be a method, and add it if so. Example: