diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2015-06-28 00:20:59 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2015-06-29 07:36:59 +0200 |
| commit | 14e3d26b8a19c56c2c2b2b99ee870a9002bb70e0 (patch) | |
| tree | c20894e979440a55d25ddf8c8b4df15528bac7aa | |
| parent | d73cc565656c76cb5270934caaafa78760cc565b (diff) | |
| download | rust-14e3d26b8a19c56c2c2b2b99ee870a9002bb70e0.tar.gz rust-14e3d26b8a19c56c2c2b2b99ee870a9002bb70e0.zip | |
Add E0110 error explanation
| -rw-r--r-- | src/librustc/diagnostics.rs | 21 | ||||
| -rw-r--r-- | src/librustc_typeck/diagnostics.rs | 3 |
2 files changed, 22 insertions, 2 deletions
diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index b15bcb7b758..8d51674ab13 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -361,13 +361,31 @@ http://doc.rust-lang.org/reference.html#ffi-attributes "##, E0109: r##" -You tried to give type parameter to a type which doesn't need it. Erroneous +You tried to give type parameter to a type which doesn't need it. Erroneous code example: ``` type X = u32<i32>; // error: type parameters are not allowed on this type ``` +Please check that you used the correct type and recheck its definition. Perhaps +it doesn't need the type parameter. +Example: + +``` +type X = u32; // ok! +``` +"##, + +E0110: r##" +You tried to give a lifetime parameter to a type which doesn't need it. +Erroneous code example: + +``` +type X = u32<'static>; // error: lifetime parameters are not allowed on + // this type +``` + Please check you actually used the good type or check again its definition. Example: @@ -1071,7 +1089,6 @@ register_diagnostics! { E0017, E0022, E0038, - E0110, E0134, E0135, E0136, diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index bf2913c83a1..d4977c5d394 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -1010,12 +1010,15 @@ example: ``` type Foo<T> = u32; // error: type parameter `T` is unused +// or: +type Foo<A,B> = Box<A>; // error: type parameter `B` is unused ``` Please check you didn't write too many type parameters. Example: ``` type Foo = u32; // ok! +type Foo<A> = Box<A>; // ok! ``` "##, |
