about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNick Hamann <nick@wabbo.org>2015-05-19 00:42:53 -0500
committerNick Hamann <nick@wabbo.org>2015-05-19 14:00:30 -0500
commit50b802ade0d9aecf3a781c98c8f051b3714db3ea (patch)
tree8785c27fad0fd9efbe655d7ecbb8b78b3c140c41
parent35d979d8f8bb63b6063e30954c7c71ddf863b380 (diff)
downloadrust-50b802ade0d9aecf3a781c98c8f051b3714db3ea.tar.gz
rust-50b802ade0d9aecf3a781c98c8f051b3714db3ea.zip
Add error explanations for E0185, E0186.
-rw-r--r--src/librustc_typeck/diagnostics.rs44
1 files changed, 42 insertions, 2 deletions
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs
index 00cdc6eb99f..549478e4153 100644
--- a/src/librustc_typeck/diagnostics.rs
+++ b/src/librustc_typeck/diagnostics.rs
@@ -443,6 +443,48 @@ it has been disabled for now.
 [iss20126]: https://github.com/rust-lang/rust/issues/20126
 "##,
 
+E0185: r##"
+An associated function for a trait was defined to be static, but an
+implementation of the trait declared the same function to be a method (i.e. to
+take a `self` parameter).
+
+Here's an example of this error:
+
+```
+trait Foo {
+    fn foo();
+}
+
+struct Bar;
+
+impl Foo for Bar {
+    // error, method `foo` has a `&self` declaration in the impl, but not in
+    // the trait
+    fn foo(&self) {}
+}
+"##,
+
+E0186: r##"
+An associated function for a trait was defined to be a method (i.e. to take a
+`self` parameter), but an implementation of the trait declared the same function
+to be static.
+
+Here's an example of this error:
+
+```
+trait Foo {
+    fn foo(&self);
+}
+
+struct Bar;
+
+impl Foo for Bar {
+    // error, method `foo` has a `&self` declaration in the trait, but not in
+    // the impl
+    fn foo() {}
+}
+"##,
+
 E0197: r##"
 Inherent implementations (one that do not implement a trait but provide
 methods associated with a type) are always safe because they are not
@@ -828,8 +870,6 @@ register_diagnostics! {
     E0174, // explicit use of unboxed closure methods are experimental
     E0182,
     E0183,
-    E0185,
-    E0186,
     E0187, // can't infer the kind of the closure
     E0188, // types differ in mutability
     E0189, // can only cast a boxed pointer to a boxed object