Navigation Menu

Skip to content

Commit

Permalink
Improve E0599 explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed May 20, 2020
1 parent 97f3eee commit e9ae64c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/librustc_error_codes/error_codes/E0599.md
Expand Up @@ -9,3 +9,18 @@ let x = Mouth;
x.chocolate(); // error: no method named `chocolate` found for type `Mouth`
// in the current scope
```

In this case, you need to implement the `chocolate` method to fix the error:

```
struct Mouth;
impl Mouth {
fn chocolate(&self) { // We implement the `chocolate` method here.
println!("Hmmm! I love chocolate!");
}
}
let x = Mouth;
x.chocolate(); // ok!
```

0 comments on commit e9ae64c

Please sign in to comment.