about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2015-08-23 00:50:19 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2015-08-23 00:50:19 +0200
commit565070948f8b2aff522d522b7a4be65790570b41 (patch)
treeafb25edfda1c8b9bffa043a37cf6676a86187c63
parent73b369d7ab5999eaebeff402edd1b2405b766a4a (diff)
downloadrust-565070948f8b2aff522d522b7a4be65790570b41.tar.gz
rust-565070948f8b2aff522d522b7a4be65790570b41.zip
Add example for E0390
-rw-r--r--src/librustc_typeck/diagnostics.rs22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs
index ac7794ea583..d35c8244ddb 100644
--- a/src/librustc_typeck/diagnostics.rs
+++ b/src/librustc_typeck/diagnostics.rs
@@ -2482,7 +2482,8 @@ impl Foo for Bar {
 }
 ```
 
-To fix this error, please verify you didn't misspell the method name. Example:
+To fix this error, please verify that the method name wasn't misspelled and
+verify that you are indeed implementing the correct trait items. Example:
 
 ```
 struct Bar;
@@ -2519,9 +2520,8 @@ impl Foo for Bar {
 }
 ```
 
-To fix this error, please verify you didn't misspell the associated type name
-and that your trait item implementation corresponds to the trait definition.
-Example:
+Please verify that the associated type name wasn't misspelled and your
+implementation corresponds to the trait definition. Example:
 
 ```
 struct Bar;
@@ -2722,8 +2722,8 @@ let x = 12f32; // error: binary operation `<<` cannot be applied to
 x << 2;
 ```
 
-To fix this error, please check this type implements this binary operation.
-Example:
+To fix this error, please check that this type implements this binary
+operation. Example:
 
 ```
 let x = 12u32; // the `u32` type does implement it:
@@ -2775,7 +2775,8 @@ For more information see the [opt-in builtin traits RFC](https://github.com/rust
 "##,
 
 E0390: r##"
-You tried to implement on an `*mut T` type. Erroneous code example:
+You tried to implement methods for a mutable raw pointer (*mut T). Erroneous
+code example:
 
 ```
 struct Foo {
@@ -2787,7 +2788,12 @@ impl *mut Foo {}
 //        `#[lang = "mut_ptr"]` is allowed for the `*mut T` primitive
 ```
 
-To fix this, please follow the compiler recommendations.
+This isn't allowed, perhaps you might get the desired effects by wrapping the
+raw pointer in a struct. Example:
+
+```
+struct FooPtr(pub *mut Foo);
+```
 "##,
 
 E0391: r##"