File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -3797,22 +3797,34 @@ E0592: r##"
37973797This error occurs when you defined methods or associated functions with same
37983798name.
37993799
3800- For example, in the following code:
3800+ Erroneous code example :
38013801
38023802```compile_fail,E0592
38033803struct Foo;
38043804
38053805impl Foo {
3806- fn bar() {}
3806+ fn bar() {} // previous definition here
38073807}
38083808
38093809impl Foo {
3810- fn bar() {}
3810+ fn bar() {} // duplicate definition here
38113811}
38123812```
38133813
38143814A similar error is E0201. The difference is whether there is one declaration
38153815block or not. To avoid this error, you have to give them one name each.
3816+
3817+ ```
3818+ struct Foo;
3819+
3820+ impl Foo {
3821+ fn bar() {}
3822+ }
3823+
3824+ impl Foo {
3825+ fn baz() {} // define with different name
3826+ }
3827+ ```
38163828"## ,
38173829
38183830E0599 : r##"
You can’t perform that action at this time.
0 commit comments