Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add long diagnostic for E0276
  • Loading branch information
Manishearth committed Jul 24, 2015
1 parent b531776 commit 522a978
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/librustc/diagnostics.rs
Expand Up @@ -1462,6 +1462,28 @@ recursive requirement that can't be resolved directly.
Consider changing your trait bounds so that they're less self-referential.
"##,

E0276: r##"
This error occurs when a bound in an implementation of a trait does not match
the bounds specified in the original trait. For example:
```
trait Foo {
fn foo<T>(x: T);
}
impl Foo for bool {
fn foo<T>(x: T) where T: Copy {}
}
```
Here, all types implementing `Foo` must have a method `foo<T>(x: T)` which can
take any type `T`. However, in the `impl` for `bool`, we have added an extra
bound that `T` is `Copy`, which isn't compatible with the original trait.
Consider removing the bound from the method or adding the bound to the original
method definition in the trait.
"##,

E0277: r##"
You tried to use a type which doesn't implement some trait in a place which
expected that trait. Erroneous code example:
Expand Down Expand Up @@ -1886,7 +1908,6 @@ register_diagnostics! {
// E0134,
// E0135,
E0264, // unknown external lang item
E0276, // requirement appears on impl method but not on corresponding trait method
E0278, // requirement is not satisfied
E0279, // requirement is not satisfied
E0280, // requirement is not satisfied
Expand Down

0 comments on commit 522a978

Please sign in to comment.