]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0622.md
Rollup merge of #102507 - scottmcm:more-binary-search-docs, r=m-ou-se
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0622.md
1 An intrinsic was declared without being a function.
2
3 Erroneous code example:
4
5 ```compile_fail,E0622
6 #![feature(intrinsics)]
7 extern "rust-intrinsic" {
8     pub static breakpoint: fn(); // error: intrinsic must be a function
9 }
10
11 fn main() { unsafe { breakpoint(); } }
12 ```
13
14 An intrinsic is a function available for use in a given programming language
15 whose implementation is handled specially by the compiler. In order to fix this
16 error, just declare a function. Example:
17
18 ```no_run
19 #![feature(intrinsics)]
20 extern "rust-intrinsic" {
21     pub fn breakpoint(); // ok!
22 }
23
24 fn main() { unsafe { breakpoint(); } }
25 ```