@@ -1439,6 +1439,29 @@ anything, please remove the attribute or add some helpful note for users of the
1439
1439
trait.
1440
1440
"## ,
1441
1441
1442
+ E0275 : r##"
1443
+ This error occurs when there was a recursive trait requirement that overflowed
1444
+ before it could be evaluated. Often this means that there is unbounded recursion
1445
+ in resolving some type bounds.
1446
+
1447
+ For example, in the following code
1448
+
1449
+ ```
1450
+ trait Foo {}
1451
+
1452
+ struct Bar<T>(T);
1453
+
1454
+ impl<T> Foo for T where Bar<T>: Foo {}
1455
+ ```
1456
+
1457
+ to determine if a `T` is `Foo`, we need to check if `Bar<T>` is `Foo`. However,
1458
+ to do this check, we need to determine that `Bar<Bar<T>>` is `Foo`. To determine
1459
+ this, we check if `Bar<Bar<Bar<T>>>` is `Foo`, and so on. This is clearly a
1460
+ recursive requirement that can't be resolved directly.
1461
+
1462
+ Consider changing your trait bounds so that they're less self-referential.
1463
+ "## ,
1464
+
1442
1465
E0277 : r##"
1443
1466
You tried to use a type which doesn't implement some trait in a place which
1444
1467
expected that trait. Erroneous code example:
@@ -1863,7 +1886,6 @@ register_diagnostics! {
1863
1886
// E0134,
1864
1887
// E0135,
1865
1888
E0264 , // unknown external lang item
1866
- E0275 , // overflow evaluating requirement
1867
1889
E0276 , // requirement appears on impl method but not on corresponding trait method
1868
1890
E0278 , // requirement is not satisfied
1869
1891
E0279 , // requirement is not satisfied
0 commit comments