about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlisdair Owens <awo101@zepler.net>2015-07-17 22:20:53 +0100
committerAlisdair Owens <awo101@zepler.net>2015-07-17 22:20:53 +0100
commitea79264ee422362428e5bd943a07f42ca885580c (patch)
treec1e50063b3b2093a6e9c0183a98d06ea27697a60
parentd4432b37378ec55450e06799f5344b4b0f4b94e0 (diff)
downloadrust-ea79264ee422362428e5bd943a07f42ca885580c.tar.gz
rust-ea79264ee422362428e5bd943a07f42ca885580c.zip
Add diagnostics for E0392
-rw-r--r--src/librustc_typeck/diagnostics.rs36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs
index ed04fde463c..93f5fb4a537 100644
--- a/src/librustc_typeck/diagnostics.rs
+++ b/src/librustc_typeck/diagnostics.rs
@@ -2109,6 +2109,41 @@ E0380: r##"
 Default impls are only allowed for traits with no methods or associated items.
 For more information see the [opt-in builtin traits RFC](https://github.com/rust
 -lang/rfcs/blob/master/text/0019-opt-in-builtin-traits.md).
+"##,
+
+E0392: r##"
+This error indicates that a type parameter has been declared but not actually
+used.
+
+Here is an example that demonstrates the error:
+
+```
+enum Foo<T> {
+    Bar
+}
+```
+
+The first way to fix this error is by removing the type parameter, as
+shown below:
+
+```
+enum Foo {
+    Bar
+}
+```
+
+The second method is to actually make use of the type parameter:
+
+```
+enum Foo<T> {
+    Bar(T)
+}
+```
+
+See the 'Type Parameters' section of the reference for more details
+on this topic:
+
+http://doc.rust-lang.org/reference.html#type-parameters-1
 "##
 
 }
@@ -2211,7 +2246,6 @@ register_diagnostics! {
     E0390, // only a single inherent implementation marked with
            // `#[lang = \"{}\"]` is allowed for the `{}` primitive
     E0391, // unsupported cyclic reference between types/traits detected
-    E0392, // parameter `{}` is never used
     E0393, // the type parameter `{}` must be explicitly specified in an object
            // type because its default value `{}` references the type `Self`"
     E0399, // trait items need to be implemented because the associated