diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2015-08-28 16:57:29 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2015-09-01 01:22:44 +0200 |
| commit | ae0409b6958429b99752102562ca747c8a0b04f0 (patch) | |
| tree | cd812e2b22b54a94b31379241fa960511a5063b5 | |
| parent | 7daf235277893f9747d96fe5630e7cd21e6a94d3 (diff) | |
| download | rust-ae0409b6958429b99752102562ca747c8a0b04f0.tar.gz rust-ae0409b6958429b99752102562ca747c8a0b04f0.zip | |
Add E0439 error explanation
| -rw-r--r-- | src/librustc_resolve/diagnostics.rs | 14 | ||||
| -rw-r--r-- | src/librustc_typeck/diagnostics.rs | 34 |
2 files changed, 34 insertions, 14 deletions
diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index 5620460d1db..f06fd9f70e2 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -398,15 +398,15 @@ impl Bar { "##, 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, diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index ed864b02551..e356f612cde 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -3020,8 +3020,29 @@ parameters. You can read more about it in the API documentation: 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 @@ extern "platform-intrinsic" { } ``` -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 @@ extern "platform-intrinsic" { "##, 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 i64x2(i64, i64); 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 @@ register_diagnostics! { 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: `{}` } |
