File tree 1 file changed +7
-5
lines changed
src/librustc_error_codes/error_codes
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 1
- When ` Trait2 ` is a subtrait of ` Trait1 ` (for example, when ` Trait2 ` has a
2
- definition like ` trait Trait2: Trait1 { ... } ` ), it is not allowed to implement
3
- ` Trait1 ` for ` Trait2 ` . This is because ` Trait2 ` already implements ` Trait1 ` by
4
- definition, so it is not useful to do this.
1
+ A trait was implemented on another which already automatically implemented it.
5
2
6
- Example :
3
+ Erroneous code examples :
7
4
8
5
``` compile_fail,E0371
9
6
trait Foo { fn foo(&self) { } }
@@ -15,3 +12,8 @@ impl Foo for Baz { } // error, `Baz` implements `Bar` which implements `Foo`
15
12
impl Baz for Baz { } // error, `Baz` (trivially) implements `Baz`
16
13
impl Baz for Bar { } // Note: This is OK
17
14
```
15
+
16
+ When ` Trait2 ` is a subtrait of ` Trait1 ` (for example, when ` Trait2 ` has a
17
+ definition like ` trait Trait2: Trait1 { ... } ` ), it is not allowed to implement
18
+ ` Trait1 ` for ` Trait2 ` . This is because ` Trait2 ` already implements ` Trait1 ` by
19
+ definition, so it is not useful to do this.
You can’t perform that action at this time.
0 commit comments