File tree 1 file changed +11
-3
lines changed
src/librustc_error_codes/error_codes
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,21 @@ Erroneous code example:
5
5
``` compile_fail,E0622
6
6
#![feature(intrinsics)]
7
7
extern "rust-intrinsic" {
8
- pub static breakpoint : unsafe extern "rust-intrinsic" fn();
9
- // error: intrinsic must be a function
8
+ pub static breakpoint : fn(); // error: intrinsic must be a function
10
9
}
11
10
12
11
fn main() { unsafe { breakpoint(); } }
13
12
```
14
13
15
14
An intrinsic is a function available for use in a given programming language
16
15
whose implementation is handled specially by the compiler. In order to fix this
17
- error, just declare a function.
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
+ ```
You can’t perform that action at this time.
0 commit comments