Closed
Description
I tried this code:
struct Thing {
state: u8,
}
impl Thing {
fn oof(*mut Self) {
self.state = 1;
}
}
I get this diagnostic, which is all good until it tries to construct a suggestion:
error[E0424]: expected value, found module `self`
--> src/lib.rs:7:9
|
6 | fn oof(*mut Self) {
| --- this function doesn't have a `self` parameter
7 | self.state = 1;
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
|
help: add a `self` receiver parameter to make the associated `fn` a method
|
6 | fn oof&self, (*mut Self) {
| ++++++
This suggestion has behaved like this since it was added in 1.47.