Rollup merge of #68897 - GuillaumeGomez:clean-up-e0275, r=Dylan-DPC

clean up E0275 explanation

r? @Dylan-DPC
This commit is contained in:
Dylan DPC 2020-02-10 17:28:54 +01:00 committed by GitHub
commit 1e26a1c4d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -1,8 +1,6 @@
This error occurs when there was a recursive trait requirement that overflowed
before it could be evaluated. Often this means that there is unbounded
recursion in resolving some type bounds.
An evaluation of a trait requirement overflowed.
For example, in the following code:
Erroneous code example:
```compile_fail,E0275
trait Foo {}
@ -12,6 +10,10 @@ struct Bar<T>(T);
impl<T> Foo for T where Bar<T>: Foo {}
```
This error occurs when there was a recursive trait requirement that overflowed
before it could be evaluated. This often means that there is an unbounded
recursion in resolving some type bounds.
To determine if a `T` is `Foo`, we need to check if `Bar<T>` is `Foo`. However,
to do this check, we need to determine that `Bar<Bar<T>>` is `Foo`. To
determine this, we check if `Bar<Bar<Bar<T>>>` is `Foo`, and so on. This is