Skip to content

Commit

Permalink
Fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Jun 14, 2019
1 parent 047f9bc commit e252aae
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/librustc_typeck/error_codes.rs
Expand Up @@ -3797,22 +3797,34 @@ E0592: r##"
This error occurs when you defined methods or associated functions with same
name.
For example, in the following code:
Erroneous code example:
```compile_fail,E0592
struct Foo;
impl Foo {
fn bar() {}
fn bar() {} // previous definition here
}
impl Foo {
fn bar() {}
fn bar() {} // duplicate definition here
}
```
A similar error is E0201. The difference is whether there is one declaration
block or not. To avoid this error, you have to give them one name each.
```
struct Foo;
impl Foo {
fn bar() {}
}
impl Foo {
fn baz() {} // define with different name
}
```
"##,

E0599: r##"
Expand Down

0 comments on commit e252aae

Please sign in to comment.