1 // Test that we give suitable error messages when the user attempts to
2 // impl a trait `Trait` for its own object type.
4 trait Foo { fn dummy(&self) { } }
8 // Supertraits of Baz are not legal:
9 impl Foo for dyn Baz { }
11 impl Bar for dyn Baz { }
13 impl Baz for dyn Baz { }
16 // But other random traits are:
18 impl Other for dyn Baz { } // OK, Other not a supertrait of Baz