1 A trait was implemented on another which already automatically implemented it.
3 Erroneous code examples:
6 trait Foo { fn foo(&self) { } }
10 impl Bar for Baz { } // error, `Baz` implements `Bar` by definition
11 impl Foo for Baz { } // error, `Baz` implements `Bar` which implements `Foo`
12 impl Baz for Baz { } // error, `Baz` (trivially) implements `Baz`
13 impl Baz for Bar { } // Note: This is OK
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.