]> git.lizzy.rs Git - rust.git/commitdiff
Fix the error explanation for E0053.
authorNick Hamann <nick@wabbo.org>
Tue, 19 May 2015 05:33:39 +0000 (00:33 -0500)
committerNick Hamann <nick@wabbo.org>
Tue, 19 May 2015 05:33:39 +0000 (00:33 -0500)
src/librustc_typeck/diagnostics.rs

index 6bac029944134eca10f24726f62e4555ae288524..00cdc6eb99f9ca62c9fa159944f3c4a545dfd517 100644 (file)
@@ -65,40 +65,27 @@ fn foo(&self) -> bool { true }
 "##,
 
 E0053: r##"
-For any given method of a trait, the mutabilities of the parameters must match
-between the trait definition and the implementation.
+The parameters of any trait method must match between a trait implementation
+and the trait definition.
 
-Here's an example where the mutability of the `self` parameter is wrong:
+Here are a couple examples of this error:
 
 ```
-trait Foo { fn foo(&self); }
-
-struct Bar;
-
-impl Foo for Bar {
-    // error, the signature should be `fn foo(&self)` instead
-    fn foo(&mut self) { }
+trait Foo {
+    fn foo(x: u16);
+    fn bar(&self);
 }
 
-fn main() {}
-```
-
-Here's another example, this time for a non-`self` parameter:
-
-```
-trait Foo { fn foo(x: &mut bool) -> bool; }
-
 struct Bar;
 
 impl Foo for Bar {
-    // error, the type of `x` should be `&mut bool` instead
-    fn foo(x: &bool) -> bool { *x }
-}
+    // error, expected u16, found i16
+    fn foo(x: i16) { }
 
-fn main() {}
+    // error, values differ in mutability
+    fn foo(&mut self) { }
+}
 ```
-
-
 "##,
 
 E0054: r##"