Skip to content

Commit

Permalink
modify intrinsic doc-comment as well
Browse files Browse the repository at this point in the history
  • Loading branch information
BatmanAoD committed Aug 11, 2024
1 parent 2a5eeb8 commit 39acc84
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions library/core/src/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2662,18 +2662,21 @@ extern "rust-intrinsic" {
pub fn discriminant_value<T>(v: &T) -> <T as DiscriminantKind>::Discriminant;

/// Rust's "try catch" construct for unwinding. Invokes the function pointer `try_fn` with the
/// data pointer `data`, and calls `catch_fn` if a panic occurs while `try_fn` runs. It is
/// undefined behavior to catch an unwinding operation from another language with this
/// function.
/// data pointer `data`, and calls `catch_fn` if unwinding occurs while `try_fn` runs.
///
/// `catch_fn` must not unwind.
///
/// The third argument is a function called if an unwind occurs (both Rust unwinds and foreign
/// unwinds). This function takes the data pointer and a pointer to the target-specific
/// exception object that was caught. For more information, see the compiler's source as well as
/// std's `catch_unwind` implementation.
/// The third argument is a function called if an unwind occurs (both Rust `panic` and foreign
/// unwinds). This function takes the data pointer and a pointer to the target- and
/// runtime-specific exception object that was caught.
///
/// The stable version of this intrinsic is `std::panic::catch_unwind`.
/// Note that in the case of a foreign unwinding operation, the exception object data may not be
/// safely usable from Rust, and should not be directly exposed via the standard library. To
/// prevent unsafe access, the library implementation may either abort the process or present an
/// opaque error type to the user.
///
/// For more information, see the compiler's source, as well as the documentation for the stable
/// version of this intrinsic, `std::panic::catch_unwind`.
#[rustc_nounwind]
pub fn catch_unwind(try_fn: fn(*mut u8), data: *mut u8, catch_fn: fn(*mut u8, *mut u8)) -> i32;

Expand Down

0 comments on commit 39acc84

Please sign in to comment.