about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlisdair Owens <awo101@zepler.net>2015-08-10 20:53:37 +0100
committerAlisdair Owens <awo101@zepler.net>2015-08-11 15:09:09 +0100
commitfef60c03e02f728a7b2b81e61dc27137393c99bc (patch)
tree91c7998523a6cf8d2c49cbae25ba6e048803ffd7 /src
parentc756526eb2aed91e96d2b5d9461898cb33565707 (diff)
downloadrust-fef60c03e02f728a7b2b81e61dc27137393c99bc.tar.gz
rust-fef60c03e02f728a7b2b81e61dc27137393c99bc.zip
add long diagnostics for E0194
Diffstat (limited to 'src')
-rw-r--r--src/librustc_typeck/diagnostics.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs
index bd4e4fc3110..e7f3c780fac 100644
--- a/src/librustc_typeck/diagnostics.rs
+++ b/src/librustc_typeck/diagnostics.rs
@@ -1840,6 +1840,22 @@ Since we know for certain that Wrapper<u32> implements Clone, there's no reason
 to also specify it in a `where` clause.
 "##,
 
+E0194: r##"
+A type parameter was declared which shadows an existing one. An example of this
+error:
+
+```
+trait Foo<T> {
+    fn do_something(&self) -> T;
+    fn do_something_else<T: Clone>(&self, bar: T);
+}
+```
+
+In this example, the trait `Foo` and the trait method `do_something_else` both
+define a type parameter `T`. This is not allowed: if the method wishes to
+define a type parameter, it must use a different name for it.
+"##,
+
 E0195: r##"
 Your method's lifetime parameters do not match the trait declaration.
 Erroneous code example:
@@ -2595,7 +2611,6 @@ register_diagnostics! {
     E0188, // can not cast a immutable reference to a mutable pointer
     E0189, // deprecated: can only cast a boxed pointer to a boxed object
     E0190, // deprecated: can only cast a &-pointer to an &-object
-    E0194,
     E0196, // cannot determine a type for this closure
     E0203, // type parameter has more than one relaxed default bound,
            // and only one is supported