diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-12-22 20:39:25 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-12-22 20:39:25 +0100 |
| commit | 1474d2a41a32f7f969c7d924ea917a1390ebe1c6 (patch) | |
| tree | 582a6739df0f53c6aa0d523155d1767967d3c6d3 /src/librustc_error_codes/error_codes | |
| parent | 4ee18c94d4969a49b81b726260a093f3fd201070 (diff) | |
| download | rust-1474d2a41a32f7f969c7d924ea917a1390ebe1c6.tar.gz rust-1474d2a41a32f7f969c7d924ea917a1390ebe1c6.zip | |
Clean up E0128 explanation
Diffstat (limited to 'src/librustc_error_codes/error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0128.md | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/librustc_error_codes/error_codes/E0128.md b/src/librustc_error_codes/error_codes/E0128.md index d0a4b32f968..6f8dfe3a73b 100644 --- a/src/librustc_error_codes/error_codes/E0128.md +++ b/src/librustc_error_codes/error_codes/E0128.md @@ -1,4 +1,5 @@ -Type parameter defaults can only use parameters that occur before them. +A type parameter with default value is using forward declared identifier. + Erroneous code example: ```compile_fail,E0128 @@ -7,11 +8,11 @@ struct Foo<T = U, U = ()> { field2: U, } // error: type parameters with a default cannot use forward declared -// identifiers +// identifiers ``` -Since type parameters are evaluated in-order, you may be able to fix this issue -by doing: +Type parameter defaults can only use parameters that occur before them. Since +type parameters are evaluated in-order, this issue could be fixed by doing: ``` struct Foo<U = (), T = U> { |
