File tree 1 file changed +22
-1
lines changed
1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -1462,6 +1462,28 @@ recursive requirement that can't be resolved directly.
1462
1462
Consider changing your trait bounds so that they're less self-referential.
1463
1463
"## ,
1464
1464
1465
+ E0276 : r##"
1466
+ This error occurs when a bound in an implementation of a trait does not match
1467
+ the bounds specified in the original trait. For example:
1468
+
1469
+ ```
1470
+ trait Foo {
1471
+ fn foo<T>(x: T);
1472
+ }
1473
+
1474
+ impl Foo for bool {
1475
+ fn foo<T>(x: T) where T: Copy {}
1476
+ }
1477
+ ```
1478
+
1479
+ Here, all types implementing `Foo` must have a method `foo<T>(x: T)` which can
1480
+ take any type `T`. However, in the `impl` for `bool`, we have added an extra
1481
+ bound that `T` is `Copy`, which isn't compatible with the original trait.
1482
+
1483
+ Consider removing the bound from the method or adding the bound to the original
1484
+ method definition in the trait.
1485
+ "## ,
1486
+
1465
1487
E0277 : r##"
1466
1488
You tried to use a type which doesn't implement some trait in a place which
1467
1489
expected that trait. Erroneous code example:
@@ -1886,7 +1908,6 @@ register_diagnostics! {
1886
1908
// E0134,
1887
1909
// E0135,
1888
1910
E0264 , // unknown external lang item
1889
- E0276 , // requirement appears on impl method but not on corresponding trait method
1890
1911
E0278 , // requirement is not satisfied
1891
1912
E0279 , // requirement is not satisfied
1892
1913
E0280 , // requirement is not satisfied
You can’t perform that action at this time.
0 commit comments