Rollup merge of #67547 - GuillaumeGomez:cleanup-err-codes, r=Dylan-DPC

Cleanup err codes

r? @Dylan-DPC
This commit is contained in:
Mazdak Farrokhzad 2019-12-24 04:39:57 +01:00 committed by GitHub
commit d130e8d550
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -1,5 +1,6 @@
You declared two fields of a struct with the same name. Erroneous code
example:
A struct was declared with two fields having the same name.
Erroneous code example:
```compile_fail,E0124
struct Foo {

View File

@ -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> {