Skip to content

Commit 14e3d26

Browse files
Add E0110 error explanation
1 parent d73cc56 commit 14e3d26

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

src/librustc/diagnostics.rs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,13 +361,31 @@ http://doc.rust-lang.org/reference.html#ffi-attributes
361361
"##,
362362

363363
E0109: r##"
364-
You tried to give type parameter to a type which doesn't need it. Erroneous
364+
You tried to give type parameter to a type which doesn't need it. Erroneous
365365
code example:
366366
367367
```
368368
type X = u32<i32>; // error: type parameters are not allowed on this type
369369
```
370370
371+
Please check that you used the correct type and recheck its definition. Perhaps
372+
it doesn't need the type parameter.
373+
Example:
374+
375+
```
376+
type X = u32; // ok!
377+
```
378+
"##,
379+
380+
E0110: r##"
381+
You tried to give a lifetime parameter to a type which doesn't need it.
382+
Erroneous code example:
383+
384+
```
385+
type X = u32<'static>; // error: lifetime parameters are not allowed on
386+
// this type
387+
```
388+
371389
Please check you actually used the good type or check again its definition.
372390
Example:
373391
@@ -1071,7 +1089,6 @@ register_diagnostics! {
10711089
E0017,
10721090
E0022,
10731091
E0038,
1074-
E0110,
10751092
E0134,
10761093
E0135,
10771094
E0136,

src/librustc_typeck/diagnostics.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,12 +1010,15 @@ example:
10101010
10111011
```
10121012
type Foo<T> = u32; // error: type parameter `T` is unused
1013+
// or:
1014+
type Foo<A,B> = Box<A>; // error: type parameter `B` is unused
10131015
```
10141016
10151017
Please check you didn't write too many type parameters. Example:
10161018
10171019
```
10181020
type Foo = u32; // ok!
1021+
type Foo<A> = Box<A>; // ok!
10191022
```
10201023
"##,
10211024

0 commit comments

Comments
 (0)