File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
src/librustc_error_codes/error_codes Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,21 @@ Erroneous code example:
55``` compile_fail,E0622
66#![feature(intrinsics)]
77extern "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
109}
1110
1211fn main() { unsafe { breakpoint(); } }
1312```
1413
1514An intrinsic is a function available for use in a given programming language
1615whose 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