]>
Commit | Line | Data |
---|---|---|
136023e0 | 1 | An invalid number of generic parameters was passed to an intrinsic function. |
60c5eb7d XL |
2 | |
3 | Erroneous code example: | |
4 | ||
5 | ```compile_fail,E0094 | |
781aab86 | 6 | #![feature(intrinsics, rustc_attrs)] |
add651ee | 7 | #![allow(internal_features)] |
60c5eb7d XL |
8 | |
9 | extern "rust-intrinsic" { | |
2b03887a | 10 | #[rustc_safe_intrinsic] |
60c5eb7d XL |
11 | fn size_of<T, U>() -> usize; // error: intrinsic has wrong number |
12 | // of type parameters | |
13 | } | |
14 | ``` | |
15 | ||
16 | Please check that you provided the right number of type parameters | |
17 | and verify with the function declaration in the Rust source code. | |
18 | Example: | |
19 | ||
20 | ``` | |
781aab86 | 21 | #![feature(intrinsics, rustc_attrs)] |
add651ee | 22 | #![allow(internal_features)] |
60c5eb7d XL |
23 | |
24 | extern "rust-intrinsic" { | |
2b03887a | 25 | #[rustc_safe_intrinsic] |
60c5eb7d XL |
26 | fn size_of<T>() -> usize; // ok! |
27 | } | |
28 | ``` |