Add error explanations for E0072, E0073, E0121, E0178, E0371, E0372.

This commit is contained in:
Nick Hamann 2015-05-14 15:42:35 -05:00
parent 8b7c17db22
commit c69a152018
2 changed files with 123 additions and 8 deletions

View file

@ -15,14 +15,14 @@ trait Foo { fn dummy(&self) { } }
trait Bar: Foo { }
trait Baz: Bar { }
// Subtraits of Baz are not legal:
// Supertraits of Baz are not legal:
impl Foo for Baz { } //~ ERROR E0371
impl Bar for Baz { } //~ ERROR E0371
impl Baz for Baz { } //~ ERROR E0371
// But other random traits are:
trait Other { }
impl Other for Baz { } // OK, Bar not a subtrait of Baz
impl Other for Baz { } // OK, Other not a supertrait of Baz
// If the trait is not object-safe, we give a more tailored message
// because we're such schnuckels: