diff --git a/compiler/rustc_error_codes/src/error_codes/E0371.md b/compiler/rustc_error_codes/src/error_codes/E0371.md index a44721346e20d..aacaee0c1b6e0 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0371.md +++ b/compiler/rustc_error_codes/src/error_codes/E0371.md @@ -7,10 +7,18 @@ trait Foo { fn foo(&self) { } } trait Bar: Foo { } trait Baz: Bar { } -impl Bar for Baz { } // error, `Baz` implements `Bar` by definition -impl Foo for Baz { } // error, `Baz` implements `Bar` which implements `Foo` -impl Baz for Baz { } // error, `Baz` (trivially) implements `Baz` -impl Baz for Bar { } // Note: This is OK +impl Bar for dyn Baz { } // error, `Baz` implements `Bar` by definition +impl Foo for dyn Baz { } // error, `Baz` implements `Bar` which implements `Foo` +impl Baz for dyn Baz { } // error, `Baz` (trivially) implements `Baz` +``` + +This is okay, because `Bar` does not implement `Baz` by definition: + +``` +# trait Foo { fn foo(&self) { } } +# trait Bar: Foo { } +# trait Baz: Bar { } +impl Baz for dyn Bar { } // Note: This is OK ``` When `Trait2` is a subtrait of `Trait1` (for example, when `Trait2` has a