Skip to content

Commit 7daf235

Browse files
Add E0440 error explanation
1 parent dc70eca commit 7daf235

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

src/librustc_typeck/diagnostics.rs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3020,6 +3020,34 @@ 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+
E0440: r##"
3024+
A platform-specific intrinsic function has wrong number of type
3025+
parameters. Erroneous code example:
3026+
3027+
```
3028+
#[repr(simd)]
3029+
struct f64x2(f64, f64);
3030+
3031+
extern "platform-intrinsic" {
3032+
fn x86_mm_movemask_pd<T>(x: f64x2) -> i32;
3033+
// error: platform-specific intrinsic has wrong number of type
3034+
// parameters
3035+
}
3036+
```
3037+
3038+
Please refer to the function declaration to see if it corresponds
3039+
with yours. Example:
3040+
3041+
```
3042+
#[repr(simd)]
3043+
struct f64x2(f64, f64);
3044+
3045+
extern "platform-intrinsic" {
3046+
fn x86_mm_movemask_pd(x: f64x2) -> i32;
3047+
}
3048+
```
3049+
"##,
3050+
30233051
E0441: r##"
30243052
An unknown platform-specific intrinsic function was used. Erroneous
30253053
code example:
@@ -3218,5 +3246,4 @@ register_diagnostics! {
32183246
// type `{}` was overridden
32193247
E0436, // functional record update requires a struct
32203248
E0439, // invalid `simd_shuffle`, needs length: `{}`
3221-
E0440, // platform-specific intrinsic has wrong number of type parameters
32223249
}

0 commit comments

Comments
 (0)