File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
src/librustc_error_codes/error_codes Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1- You declared two fields of a struct with the same name. Erroneous code
2- example:
1+ A struct was declared with two fields having the same name.
2+
3+ Erroneous code example:
34
45``` compile_fail,E0124
56struct Foo {
Original file line number Diff line number Diff line change 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+
23Erroneous 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```
1718struct Foo<U = (), T = U> {
You can’t perform that action at this time.
0 commit comments