未验证 提交 47f3c440 编写于 作者: D Dylan DPC 提交者: GitHub

Rollup merge of #72375 - GuillaumeGomez:cleanup-e0599, r=Dylan-DPC

Improve E0599 explanation

r? @Dylan-DPC
......@@ -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!
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册