Skip to content

Commit 2ac1ebb

Browse files
committed
---
yaml --- r: 221548 b: refs/heads/snap-stage3 c: b531776 h: refs/heads/master v: v3
1 parent c9889d6 commit 2ac1ebb

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 607f74df2ad6b6fb32ce5b862a9e48a8c4afdad2
3-
refs/heads/snap-stage3: dc556bef4313b59f082a1a0f7f2d30ef9cc88c0c
3+
refs/heads/snap-stage3: b5317761b8202affde7493d9b81a049b4727c29e
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/snap-stage3/src/librustc/diagnostics.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1439,6 +1439,29 @@ anything, please remove the attribute or add some helpful note for users of the
14391439
trait.
14401440
"##,
14411441

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+
14421465
E0277: r##"
14431466
You tried to use a type which doesn't implement some trait in a place which
14441467
expected that trait. Erroneous code example:
@@ -1863,7 +1886,6 @@ register_diagnostics! {
18631886
// E0134,
18641887
// E0135,
18651888
E0264, // unknown external lang item
1866-
E0275, // overflow evaluating requirement
18671889
E0276, // requirement appears on impl method but not on corresponding trait method
18681890
E0278, // requirement is not satisfied
18691891
E0279, // requirement is not satisfied

0 commit comments

Comments
 (0)