Skip to content

Commit 7160d92

Browse files
Add E0128 error explanation
1 parent c83f8f9 commit 7160d92

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/librustc_typeck/diagnostics.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1368,6 +1368,26 @@ struct Foo {
13681368
```
13691369
"##,
13701370

1371+
E0128: r##"
1372+
You declared a type parameter with a default which has the same identifier as
1373+
the type parameter. Erroneous code example:
1374+
1375+
```
1376+
pub struct Foo<SomeType=SomeType>;
1377+
// error: type parameters with a default cannot use forward declared
1378+
// identifiers
1379+
```
1380+
1381+
Please verify you used the good type or change the type parameter identifier.
1382+
Example:
1383+
1384+
```
1385+
pub struct Foo<T=SomeType> {
1386+
value: T
1387+
}
1388+
```
1389+
"##,
1390+
13711391
E0131: r##"
13721392
It is not possible to define `main` with type parameters, or even with function
13731393
parameters. When `main` is present, it must take no arguments and return `()`.
@@ -1978,7 +1998,6 @@ register_diagnostics! {
19781998
E0122,
19791999
E0123,
19802000
E0127,
1981-
E0128,
19822001
E0129,
19832002
E0130,
19842003
E0141,

0 commit comments

Comments
 (0)