@@ -1587,6 +1587,46 @@ This will fail because the compiler does not know which instance of `Foo` to
1587
1587
call `bar` on. Change `Foo::bar()` to `Foo::<T>::bar()` to resolve the error.
1588
1588
"## ,
1589
1589
1590
+ E0283 : r##"
1591
+ This error occurs when the compiler doesn't have enough information
1592
+ to unambiguously choose an implementation.
1593
+
1594
+ For example:
1595
+
1596
+ ```
1597
+ trait Generator {
1598
+ fn create() -> u32;
1599
+ }
1600
+
1601
+ struct Impl;
1602
+ impl Generator for Impl {
1603
+ fn create() -> u32 { 1 }
1604
+ }
1605
+
1606
+ struct AnotherImpl;
1607
+ impl Generator for AnotherImpl {
1608
+ fn create() -> u32 { 2 }
1609
+ }
1610
+
1611
+ fn main() {
1612
+ let cont: u32 = Generator::create();
1613
+ // error, impossible to choose one of Generator trait implementation
1614
+ // Impl or AnotherImpl? Maybe anything else?
1615
+ }
1616
+ ```
1617
+
1618
+ To resolve this error use the concrete type:
1619
+
1620
+ ```
1621
+ fn main() {
1622
+ let gen1 = AnotherImpl::create();
1623
+
1624
+ // if there are multiple methods with same name (different traits)
1625
+ let gen2 = <AnotherImpl as Generator>::create();
1626
+ }
1627
+ ```
1628
+ "## ,
1629
+
1590
1630
E0296 : r##"
1591
1631
This error indicates that the given recursion limit could not be parsed. Ensure
1592
1632
that the value provided is a positive integer between quotes, like so:
@@ -1900,7 +1940,6 @@ register_diagnostics! {
1900
1940
E0278 , // requirement is not satisfied
1901
1941
E0279 , // requirement is not satisfied
1902
1942
E0280 , // requirement is not satisfied
1903
- E0283 , // cannot resolve type
1904
1943
E0284 , // cannot resolve type
1905
1944
E0285 , // overflow evaluation builtin bounds
1906
1945
E0298 , // mismatched types between arms
0 commit comments