Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/librustc_error_codes/error_codes/E0622.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,21 @@ Erroneous code example:
```compile_fail,E0622
#![feature(intrinsics)]
extern "rust-intrinsic" {
pub static breakpoint : unsafe extern "rust-intrinsic" fn();
// error: intrinsic must be a function
pub static breakpoint : fn(); // error: intrinsic must be a function
}

fn main() { unsafe { breakpoint(); } }
```

An intrinsic is a function available for use in a given programming language
whose implementation is handled specially by the compiler. In order to fix this
error, just declare a function.
error, just declare a function. Example:

```no_run
#![feature(intrinsics)]
extern "rust-intrinsic" {
pub fn breakpoint(); // ok!
}

fn main() { unsafe { breakpoint(); } }
```