diff options
| author | Josh Triplett <josh@joshtriplett.org> | 2024-12-01 19:07:13 -0800 |
|---|---|---|
| committer | Josh Triplett <josh@joshtriplett.org> | 2024-12-02 23:56:24 -0800 |
| commit | a030ffbe354be8072fe2749d89c66365c192b0fe (patch) | |
| tree | c78adb8413e72ffe2733e9deec90ac27c6e40402 /compiler/rustc_error_codes/src | |
| parent | a522d78598415cdd614ccc6d961160f192f64b5c (diff) | |
| download | rust-a030ffbe354be8072fe2749d89c66365c192b0fe.tar.gz rust-a030ffbe354be8072fe2749d89c66365c192b0fe.zip | |
Add `core::arch::breakpoint` and test
Approved in [ACP 491](https://github.com/rust-lang/libs-team/issues/491). Remove the `unsafe` on `core::intrinsics::breakpoint()`, since it's a safe intrinsic to call and has no prerequisites. (Thanks to @zachs18 for figuring out the `bootstrap`/`not(bootstrap)` logic.)
Diffstat (limited to 'compiler/rustc_error_codes/src')
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0622.md | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0622.md b/compiler/rustc_error_codes/src/error_codes/E0622.md index 5d71ee9949d..4cb605b636d 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0622.md +++ b/compiler/rustc_error_codes/src/error_codes/E0622.md @@ -7,10 +7,11 @@ Erroneous code example: #![allow(internal_features)] extern "rust-intrinsic" { - pub static breakpoint: fn(); // error: intrinsic must be a function + pub static atomic_singlethreadfence_seqcst: fn(); + // error: intrinsic must be a function } -fn main() { unsafe { breakpoint(); } } +fn main() { unsafe { atomic_singlethreadfence_seqcst(); } } ``` An intrinsic is a function available for use in a given programming language @@ -22,8 +23,8 @@ error, just declare a function. Example: #![allow(internal_features)] extern "rust-intrinsic" { - pub fn breakpoint(); // ok! + pub fn atomic_singlethreadfence_seqcst(); // ok! } -fn main() { unsafe { breakpoint(); } } +fn main() { unsafe { atomic_singlethreadfence_seqcst(); } } ``` |
