]> git.lizzy.rs Git - rust.git/commitdiff
Add E0439 error explanation
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Fri, 28 Aug 2015 14:57:29 +0000 (16:57 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Mon, 31 Aug 2015 23:22:44 +0000 (01:22 +0200)
src/librustc_resolve/diagnostics.rs
src/librustc_typeck/diagnostics.rs

index 5620460d1db40f65df6ae01d29e80df4119cc348..f06fd9f70e2c1f1e118b842e3c6d60f601bbd9af 100644 (file)
@@ -398,15 +398,15 @@ fn b() {}
 "##,
 
 E0411: r##"
-`Self` keyword was used outside an impl or a trait. Erroneous code
-example:
+The `Self` keyword was used outside an impl or a trait. Erroneous
+code example:
 
 ```
 <Self>::foo; // error: use of `Self` outside of an impl or trait
 ```
 
 The `Self` keyword represents the current type, which explains why it
-can only be used inside an impl or a trait. It gives access to
+can only be used inside an impl or a trait. It gives access to the
 associated items of a type:
 
 ```
@@ -436,8 +436,8 @@ trait Baz : Foo + Foo2 {
 }
 ```
 
-It can be solved by specifying from which trait we want to use the
-`Bar` type:
+This problem can be solved by specifying from which trait we want
+to use the `Bar` type:
 
 ```
 trait Baz : Foo + Foo2 {
@@ -872,8 +872,8 @@ impl Foo for i32 {}
 }
 
 register_diagnostics! {
-//  E0153,
-//  E0157,
+//  E0153, unused error code
+//  E0157, unused error code
     E0254, // import conflicts with imported crate in this module
     E0257,
     E0258,
index ed864b02551af31dee6238900e272b22f8348c77..e356f612cdef24c915c1e6094e097b2836b6c837 100644 (file)
@@ -3020,8 +3020,29 @@ struct Foo<'a, T: 'a> {
 https://doc.rust-lang.org/std/marker/struct.PhantomData.html
 "##,
 
+E0439: r##"
+The length of the platform-intrinsic function `simd_shuffle`
+wasn't specified. Erroneous code example:
+
+```
+extern "platform-intrinsic" {
+    fn simd_shuffle<A,B>(a: A, b: A, c: [u32; 8]) -> B;
+    // error: invalid `simd_shuffle`, needs length: `simd_shuffle`
+}
+```
+
+The `simd_shuffle` function needs the length of the array passed as
+last parameter in its name. Example:
+
+```
+extern "platform-intrinsic" {
+    fn simd_shuffle8<A,B>(a: A, b: A, c: [u32; 8]) -> B;
+}
+```
+"##,
+
 E0440: r##"
-A platform-specific intrinsic function has wrong number of type
+A platform-specific intrinsic function has the wrong number of type
 parameters. Erroneous code example:
 
 ```
@@ -3062,8 +3083,8 @@ struct Foo<'a, T: 'a> {
 }
 ```
 
-Please check you didn't misspell the function's name or that it is
-declared in the rust source code (in the file
+Please verify that the function name wasn't misspelled, and ensure
+that it is declared in the rust source code (in the file
 src/librustc_platform_intrinsics/x86.rs). Example:
 
 ```
@@ -3077,7 +3098,7 @@ struct Foo<'a, T: 'a> {
 "##,
 
 E0442: r##"
-Intrinsic argument(s) and/or return value have the wrong length.
+Intrinsic argument(s) and/or return value have the wrong type.
 Erroneous code example:
 
 ```
@@ -3091,12 +3112,12 @@ struct i8x16(i8, i8, i8, i8, i8, i8, i8, i8,
 
 extern "platform-intrinsic" {
     fn x86_mm_adds_epi16(x: i8x16, y: i32x4) -> i64x2;
-    // error: intrinsic arguments/return value have wrong length
+    // error: intrinsic arguments/return value have wrong type
 }
 ```
 
 To fix this error, please refer to the function declaration to give
-it the awaited types with the awaited length. Example:
+it the awaited types. Example:
 
 ```
 #[repr(simd)]
@@ -3245,5 +3266,4 @@ struct i8x16(i8, i8, i8, i8, i8, i8, i8, i8,
     E0399, // trait items need to be implemented because the associated
            // type `{}` was overridden
     E0436,  // functional record update requires a struct
-    E0439, // invalid `simd_shuffle`, needs length: `{}`
 }