intrinsics: use const generic to set atomic ordering

This commit is contained in:
Ralf Jung
2025-05-28 18:37:58 +02:00
parent 5e0bdaa9dd
commit 8808c9d34b
23 changed files with 653 additions and 1474 deletions

View File

@@ -1,8 +1,10 @@
#### Note: this error code is no longer emitted by the compiler.
An undefined atomic operation function was declared.
Erroneous code example:
```compile_fail,E0092
```ignore (no longer emitted)
#![feature(intrinsics)]
#![allow(internal_features)]
@@ -12,13 +14,4 @@ unsafe fn atomic_foo(); // error: unrecognized atomic operation
```
Please check you didn't make a mistake in the function's name. All intrinsic
functions are defined in `compiler/rustc_codegen_llvm/src/intrinsic.rs` and in
`library/core/src/intrinsics.rs` in the Rust source code. Example:
```
#![feature(intrinsics)]
#![allow(internal_features)]
#[rustc_intrinsic]
unsafe fn atomic_fence_seqcst(); // ok!
```
functions are defined in `library/core/src/intrinsics` in the Rust source code.

View File

@@ -17,19 +17,4 @@ fn main() {
```
Please check you didn't make a mistake in the function's name. All intrinsic
functions are defined in `compiler/rustc_codegen_llvm/src/intrinsic.rs` and in
`library/core/src/intrinsics.rs` in the Rust source code. Example:
```
#![feature(intrinsics)]
#![allow(internal_features)]
#[rustc_intrinsic]
unsafe fn atomic_fence_seqcst(); // ok!
fn main() {
unsafe {
atomic_fence_seqcst();
}
}
```
functions are defined in `library/core/src/intrinsics` in the Rust source code.

View File

@@ -4,7 +4,7 @@ An intrinsic was declared without being a function.
Erroneous code example:
```no_run
```ignore (no longer emitted)
#![feature(intrinsics)]
#![allow(internal_features)]
@@ -21,7 +21,7 @@ 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
```ignore (no longer emitted)
#![feature(intrinsics)]
#![allow(internal_features)]