Skip to content

Commit 00fea8b

Browse files
committed
---
yaml --- r: 235808 b: refs/heads/stable c: b531776 h: refs/heads/master v: v3
1 parent 605d0b4 commit 00fea8b

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
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: dc556bef4313b59f082a1a0f7f2d30ef9cc88c0c
32+
refs/heads/stable: b5317761b8202affde7493d9b81a049b4727c29e
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/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)