Skip to content

Commit 1474d2a

Browse files
Clean up E0128 explanation
1 parent 4ee18c9 commit 1474d2a

File tree

1 file changed

+5
-4
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+5
-4
lines changed

src/librustc_error_codes/error_codes/E0128.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
Type parameter defaults can only use parameters that occur before them.
1+
A type parameter with default value is using forward declared identifier.
2+
23
Erroneous code example:
34

45
```compile_fail,E0128
@@ -7,11 +8,11 @@ struct Foo<T = U, U = ()> {
78
field2: U,
89
}
910
// error: type parameters with a default cannot use forward declared
10-
// identifiers
11+
// identifiers
1112
```
1213

13-
Since type parameters are evaluated in-order, you may be able to fix this issue
14-
by doing:
14+
Type parameter defaults can only use parameters that occur before them. Since
15+
type parameters are evaluated in-order, this issue could be fixed by doing:
1516

1617
```
1718
struct Foo<U = (), T = U> {

0 commit comments

Comments
 (0)