blob: 4cb605b636d2e7bd3f6f5c94caa103e3980413a9 [file] [log] [blame] [view]
An intrinsic was declared without being a function.
Erroneous code example:
```compile_fail,E0622
#![feature(intrinsics)]
#![allow(internal_features)]
extern "rust-intrinsic" {
pub static atomic_singlethreadfence_seqcst: 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:
```no_run
#![feature(intrinsics)]
#![allow(internal_features)]
extern "rust-intrinsic" {
pub fn atomic_singlethreadfence_seqcst(); // ok!
}
fn main() { unsafe { atomic_singlethreadfence_seqcst(); } }
```