Skip to content

Commit

Permalink
clean up E0275 explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Feb 10, 2020
1 parent 320ada6 commit 37e7b46
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/librustc_error_codes/error_codes/E0275.md
Original file line number Diff line number Diff line change
@@ -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 {}
Expand All @@ -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
Expand Down

0 comments on commit 37e7b46

Please sign in to comment.