Skip to content

Commit ae0409b

Browse files
Add E0439 error explanation
1 parent 7daf235 commit ae0409b

File tree

2 files changed

+34
-14
lines changed

2 files changed

+34
-14
lines changed

src/librustc_resolve/diagnostics.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -398,15 +398,15 @@ impl Bar {
398398
"##,
399399

400400
E0411: r##"
401-
`Self` keyword was used outside an impl or a trait. Erroneous code
402-
example:
401+
The `Self` keyword was used outside an impl or a trait. Erroneous
402+
code example:
403403
404404
```
405405
<Self>::foo; // error: use of `Self` outside of an impl or trait
406406
```
407407
408408
The `Self` keyword represents the current type, which explains why it
409-
can only be used inside an impl or a trait. It gives access to
409+
can only be used inside an impl or a trait. It gives access to the
410410
associated items of a type:
411411
412412
```
@@ -436,8 +436,8 @@ trait Baz : Foo + Foo2 {
436436
}
437437
```
438438
439-
It can be solved by specifying from which trait we want to use the
440-
`Bar` type:
439+
This problem can be solved by specifying from which trait we want
440+
to use the `Bar` type:
441441
442442
```
443443
trait Baz : Foo + Foo2 {
@@ -872,8 +872,8 @@ impl Foo for i32 {}
872872
}
873873

874874
register_diagnostics! {
875-
// E0153,
876-
// E0157,
875+
// E0153, unused error code
876+
// E0157, unused error code
877877
E0254, // import conflicts with imported crate in this module
878878
E0257,
879879
E0258,

src/librustc_typeck/diagnostics.rs

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3020,8 +3020,29 @@ parameters. You can read more about it in the API documentation:
30203020
https://doc.rust-lang.org/std/marker/struct.PhantomData.html
30213021
"##,
30223022

3023+
E0439: r##"
3024+
The length of the platform-intrinsic function `simd_shuffle`
3025+
wasn't specified. Erroneous code example:
3026+
3027+
```
3028+
extern "platform-intrinsic" {
3029+
fn simd_shuffle<A,B>(a: A, b: A, c: [u32; 8]) -> B;
3030+
// error: invalid `simd_shuffle`, needs length: `simd_shuffle`
3031+
}
3032+
```
3033+
3034+
The `simd_shuffle` function needs the length of the array passed as
3035+
last parameter in its name. Example:
3036+
3037+
```
3038+
extern "platform-intrinsic" {
3039+
fn simd_shuffle8<A,B>(a: A, b: A, c: [u32; 8]) -> B;
3040+
}
3041+
```
3042+
"##,
3043+
30233044
E0440: r##"
3024-
A platform-specific intrinsic function has wrong number of type
3045+
A platform-specific intrinsic function has the wrong number of type
30253046
parameters. Erroneous code example:
30263047
30273048
```
@@ -3062,8 +3083,8 @@ extern "platform-intrinsic" {
30623083
}
30633084
```
30643085
3065-
Please check you didn't misspell the function's name or that it is
3066-
declared in the rust source code (in the file
3086+
Please verify that the function name wasn't misspelled, and ensure
3087+
that it is declared in the rust source code (in the file
30673088
src/librustc_platform_intrinsics/x86.rs). Example:
30683089
30693090
```
@@ -3077,7 +3098,7 @@ extern "platform-intrinsic" {
30773098
"##,
30783099

30793100
E0442: r##"
3080-
Intrinsic argument(s) and/or return value have the wrong length.
3101+
Intrinsic argument(s) and/or return value have the wrong type.
30813102
Erroneous code example:
30823103
30833104
```
@@ -3091,12 +3112,12 @@ struct i64x2(i64, i64);
30913112
30923113
extern "platform-intrinsic" {
30933114
fn x86_mm_adds_epi16(x: i8x16, y: i32x4) -> i64x2;
3094-
// error: intrinsic arguments/return value have wrong length
3115+
// error: intrinsic arguments/return value have wrong type
30953116
}
30963117
```
30973118
30983119
To fix this error, please refer to the function declaration to give
3099-
it the awaited types with the awaited length. Example:
3120+
it the awaited types. Example:
31003121
31013122
```
31023123
#[repr(simd)]
@@ -3245,5 +3266,4 @@ register_diagnostics! {
32453266
E0399, // trait items need to be implemented because the associated
32463267
// type `{}` was overridden
32473268
E0436, // functional record update requires a struct
3248-
E0439, // invalid `simd_shuffle`, needs length: `{}`
32493269
}

0 commit comments

Comments
 (0)