1
Fork 0

Rollup merge of #133726 - joshtriplett:breakpoint, r=oli-obk

Add `core::arch::breakpoint` and test

Approved in [ACP 491](https://github.com/rust-lang/libs-team/issues/491).
This commit is contained in:
Matthias Krüger 2024-12-03 21:55:27 +01:00 committed by GitHub
commit e66e632479
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 66 additions and 13 deletions

View file

@ -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(); } }
```