Skip to content

Commit cbeda68

Browse files
author
Nick Hamann
committed
Add error explanation for E0201.
1 parent 71f6ed8 commit cbeda68

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/librustc_typeck/diagnostics.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,24 @@ it has been disabled for now.
350350
[iss20126]: https://github.com/rust-lang/rust/issues/20126
351351
"##,
352352

353+
E0201: r##"
354+
It is an error to define a method--a trait method or an inherent method--more
355+
than once.
356+
357+
For example,
358+
359+
```
360+
struct Foo(u8);
361+
362+
impl Foo {
363+
fn bar() {}
364+
365+
// error: duplicate method
366+
fn bar(&self) -> bool { self.0 > 5 }
367+
}
368+
```
369+
"##,
370+
353371
E0204: r##"
354372
An attempt to implement the `Copy` trait for a struct failed because one of the
355373
fields does not implement `Copy`. To fix this, you must implement `Copy` for the
@@ -580,7 +598,6 @@ register_diagnostics! {
580598
E0198, // negative implementations are not unsafe
581599
E0199, // implementing trait is not unsafe
582600
E0200, // trait requires an `unsafe impl` declaration
583-
E0201, // duplicate method in trait impl
584601
E0202, // associated items are not allowed in inherent impls
585602
E0203, // type parameter has more than one relaxed default bound,
586603
// and only one is supported

0 commit comments

Comments
 (0)