]> git.lizzy.rs Git - rust.git/commitdiff
Add example for E0390
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Sat, 22 Aug 2015 22:50:19 +0000 (00:50 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Sat, 22 Aug 2015 22:50:19 +0000 (00:50 +0200)
src/librustc_typeck/diagnostics.rs

index ac7794ea58356e8c92538a275e69d07fd2d20fd8..d35c8244ddb7075d9a3f254d524151f7661f9088 100644 (file)
@@ -2482,7 +2482,8 @@ fn N() {}
 }
 ```
 
-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 @@ fn main() {
 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 @@ impl Baz for Bar { } // Note: This is OK
 "##,
 
 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##"