@@ -1487,6 +1487,26 @@ fn main() {
1487
1487
```
1488
1488
"## ,
1489
1489
1490
+ E0281 : r##"
1491
+ You tried to supply a type which doesn't implement some trait in a location
1492
+ which expected that trait. This error typically occurs when working with
1493
+ `Fn`-based types. Erroneous code example:
1494
+
1495
+ ```
1496
+ fn foo<F: Fn()>(x: F) { }
1497
+
1498
+ fn main() {
1499
+ // type mismatch: the type ... implements the trait `core::ops::Fn<(_,)>`,
1500
+ // but the trait `core::ops::Fn<()>` is required (expected (), found tuple
1501
+ // [E0281]
1502
+ foo(|y| { });
1503
+ }
1504
+ ```
1505
+
1506
+ The issue in this case is that `foo` is defined as accepting a `Fn` with no
1507
+ arguments, but the closure we attempted to pass to it requires one argument.
1508
+ "## ,
1509
+
1490
1510
E0282 : r##"
1491
1511
This error indicates that type inference did not result in one unique possible
1492
1512
type, and extra information is required. In most cases this can be provided
@@ -1867,7 +1887,6 @@ register_diagnostics! {
1867
1887
E0278 , // requirement is not satisfied
1868
1888
E0279 , // requirement is not satisfied
1869
1889
E0280 , // requirement is not satisfied
1870
- E0281 , // type implements trait but other trait is required
1871
1890
E0283 , // cannot resolve type
1872
1891
E0284 , // cannot resolve type
1873
1892
E0285 , // overflow evaluation builtin bounds
0 commit comments