File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1014,11 +1014,7 @@ fn h1() -> i32 {
1014
1014
1015
1015
E0424 : r##"
1016
1016
The `self` keyword was used inside of an associated function without a "`self`
1017
- receiver" parameter. The `self` keyword can only be used inside methods, which
1018
- are associated functions (functions defined inside of a `trait` or `impl` block)
1019
- that have a `self` receiver as its first parameter, like `self`, `&self`,
1020
- `&mut self` or `self: &mut Pin<Self>` (this last one is an example of an
1021
- ["abitrary `self` type"](https://github.com/rust-lang/rust/issues/44874)).
1017
+ receiver" parameter.
1022
1018
1023
1019
Erroneous code example:
1024
1020
@@ -1037,6 +1033,12 @@ impl Foo {
1037
1033
}
1038
1034
```
1039
1035
1036
+ The `self` keyword can only be used inside methods, which are associated
1037
+ functions (functions defined inside of a `trait` or `impl` block) that have a
1038
+ `self` receiver as its first parameter, like `self`, `&self`, `&mut self` or
1039
+ `self: &mut Pin<Self>` (this last one is an example of an ["abitrary `self`
1040
+ type"](https://github.com/rust-lang/rust/issues/44874)).
1041
+
1040
1042
Check if the associated function's parameter list should have contained a `self`
1041
1043
receiver for it to be a method, and add it if so. Example:
1042
1044
You can’t perform that action at this time.
0 commit comments