about summary refs log tree commit diff
path: root/compiler/rustc_error_codes/src/error_codes/E0622.md
blob: cc66e0679909ed26c984cde5510e1b3f38515900 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#### Note: this error code is no longer emitted by the compiler.

An intrinsic was declared without being a function.

Erroneous code example:

```ignore (no longer emitted)
#![feature(intrinsics)]
#![allow(internal_features)]

extern "C" {
    #[rustc_intrinsic]
    pub static atomic_singlethreadfence_seqcst: unsafe fn();
    // error: intrinsic must be a function
}

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

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. Example:

```ignore (no longer emitted)
#![feature(intrinsics)]
#![allow(internal_features)]

#[rustc_intrinsic]
pub unsafe fn atomic_singlethreadfence_seqcst(); // ok!

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