Skip to content

Commit e9ae64c

Browse files
Improve E0599 explanation
1 parent 97f3eee commit e9ae64c

File tree

1 file changed

+15
-0
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+15
-0
lines changed

src/librustc_error_codes/error_codes/E0599.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,18 @@ let x = Mouth;
99
x.chocolate(); // error: no method named `chocolate` found for type `Mouth`
1010
// in the current scope
1111
```
12+
13+
In this case, you need to implement the `chocolate` method to fix the error:
14+
15+
```
16+
struct Mouth;
17+
18+
impl Mouth {
19+
fn chocolate(&self) { // We implement the `chocolate` method here.
20+
println!("Hmmm! I love chocolate!");
21+
}
22+
}
23+
24+
let x = Mouth;
25+
x.chocolate(); // ok!
26+
```

0 commit comments

Comments
 (0)