]>
Commit | Line | Data |
---|---|---|
60c5eb7d XL |
1 | An unknown intrinsic function was declared. |
2 | ||
3 | Erroneous code example: | |
4 | ||
5 | ```compile_fail,E0093 | |
6 | #![feature(intrinsics)] | |
add651ee | 7 | #![allow(internal_features)] |
60c5eb7d XL |
8 | |
9 | extern "rust-intrinsic" { | |
10 | fn foo(); // error: unrecognized intrinsic function: `foo` | |
11 | } | |
12 | ||
13 | fn main() { | |
14 | unsafe { | |
15 | foo(); | |
16 | } | |
17 | } | |
18 | ``` | |
19 | ||
20 | Please check you didn't make a mistake in the function's name. All intrinsic | |
1b1a35ee XL |
21 | functions are defined in `compiler/rustc_codegen_llvm/src/intrinsic.rs` and in |
22 | `library/core/src/intrinsics.rs` in the Rust source code. Example: | |
60c5eb7d XL |
23 | |
24 | ``` | |
25 | #![feature(intrinsics)] | |
add651ee | 26 | #![allow(internal_features)] |
60c5eb7d XL |
27 | |
28 | extern "rust-intrinsic" { | |
064997fb | 29 | fn atomic_fence_seqcst(); // ok! |
60c5eb7d XL |
30 | } |
31 | ||
32 | fn main() { | |
33 | unsafe { | |
064997fb | 34 | atomic_fence_seqcst(); |
60c5eb7d XL |
35 | } |
36 | } | |
37 | ``` |