Skip to content

Commit 2b76c8b

Browse files
committed
review comments
1 parent bd813bf commit 2b76c8b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/librustc_resolve/error_codes.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -1014,11 +1014,7 @@ fn h1() -> i32 {
10141014

10151015
E0424: r##"
10161016
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.
10221018
10231019
Erroneous code example:
10241020
@@ -1037,6 +1033,12 @@ impl Foo {
10371033
}
10381034
```
10391035
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+
10401042
Check if the associated function's parameter list should have contained a `self`
10411043
receiver for it to be a method, and add it if so. Example:
10421044

0 commit comments

Comments
 (0)