Skip to content

Commit d36b4f7

Browse files
---
yaml --- r: 233885 b: refs/heads/beta c: 297b77d h: refs/heads/master i: 233883: d53d18b v: v3
1 parent 8bb2f41 commit d36b4f7

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 954d6ae184b97b5b7a4327d73c277725807450ae
26+
refs/heads/beta: 297b77d49b2961c682e11fafb975f27780ba5625
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/librustc_typeck/diagnostics.rs

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3047,6 +3047,38 @@ extern "platform-intrinsic" {
30473047
```
30483048
"##,
30493049

3050+
E0442: r##"
3051+
Intrinsic argument(s) and/or return value have the wrong length.
3052+
Erroneous code example:
3053+
3054+
```
3055+
#[repr(simd)]
3056+
struct i8x16(i8, i8, i8, i8, i8, i8, i8, i8,
3057+
i8, i8, i8, i8, i8, i8, i8, i8);
3058+
#[repr(simd)]
3059+
struct i32x4(i32, i32, i32, i32);
3060+
#[repr(simd)]
3061+
struct i64x2(i64, i64);
3062+
3063+
extern "platform-intrinsic" {
3064+
fn x86_mm_adds_epi16(x: i8x16, y: i32x4) -> i64x2;
3065+
// error: intrinsic arguments have wrong length
3066+
}
3067+
```
3068+
3069+
To fix this error, please refer to the function declaration to give
3070+
it the awaited types with the awaited length. Example:
3071+
3072+
```
3073+
#[repr(simd)]
3074+
struct i16x8(i16, i16, i16, i16, i16, i16, i16, i16);
3075+
3076+
extern "platform-intrinsic" {
3077+
fn x86_mm_adds_epi16(x: i16x8, y: i16x8) -> i16x8; // ok!
3078+
}
3079+
```
3080+
"##
3081+
30503082
}
30513083

30523084
register_diagnostics! {
@@ -3131,7 +3163,6 @@ register_diagnostics! {
31313163
E0439, // invalid `simd_shuffle`, needs length: `{}`
31323164
E0440, // platform-specific intrinsic has wrong number of type parameters
31333165
E0441, // unrecognized platform-specific intrinsic function
3134-
E0442, // intrinsic {} has wrong type: found {}, expected {}
31353166
E0443, // intrinsic {} has wrong type: found `{}`, expected `{}` which
31363167
// was used for this vector type previously in this signature
31373168
}

0 commit comments

Comments
 (0)