diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-02-06 17:53:03 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-02-10 13:25:48 +0100 |
| commit | 37e7b461778fab0c9dbe287e4eb3b7096ad6356f (patch) | |
| tree | f3d0f52661b53cd5abfe41b07292fc2b95820e58 /src/librustc_error_codes/error_codes | |
| parent | 320ada6479b3e29c7d9a66bc56ac44c2d2b57566 (diff) | |
clean up E0275 explanation
Diffstat (limited to 'src/librustc_error_codes/error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0275.md | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/librustc_error_codes/error_codes/E0275.md b/src/librustc_error_codes/error_codes/E0275.md index 836a9a95fa1..2d12fcea4ca 100644 --- a/src/librustc_error_codes/error_codes/E0275.md +++ b/src/librustc_error_codes/error_codes/E0275.md @@ -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 |
