Skip to content

Commit 1fbc037

Browse files
Clean up E0622 explanation
1 parent 698c5c6 commit 1fbc037

File tree

1 file changed

+11
-3
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+11
-3
lines changed

src/librustc_error_codes/error_codes/E0622.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,21 @@ Erroneous code example:
55
```compile_fail,E0622
66
#![feature(intrinsics)]
77
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
109
}
1110
1211
fn main() { unsafe { breakpoint(); } }
1312
```
1413

1514
An intrinsic is a function available for use in a given programming language
1615
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+
```

0 commit comments

Comments
 (0)