about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-02-25 18:51:22 +0100
committerRalf Jung <post@ralfj.de>2024-02-26 11:10:18 +0100
commitb4ca582b8986c36d23726dc292c41b06fe7f9c6b (patch)
treec20176a516e3ac88eb7e65b6c9a03d4721edc2ca /library/std/src
parente9f95949138125bb1b98ed213a41b9aa825bacf5 (diff)
downloadrust-b4ca582b8986c36d23726dc292c41b06fe7f9c6b.tar.gz
rust-b4ca582b8986c36d23726dc292c41b06fe7f9c6b.zip
rename 'try' intrinsic to 'catch_unwind'
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/panicking.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs
index ef701d3867a..464a46264cb 100644
--- a/library/std/src/panicking.rs
+++ b/library/std/src/panicking.rs
@@ -508,12 +508,12 @@ pub unsafe fn r#try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>>
     // Access to the union's fields: this is `std` and we know that the `r#try`
     // intrinsic fills in the `r` or `p` union field based on its return value.
     //
-    // The call to `intrinsics::r#try` is made safe by:
+    // The call to `intrinsics::catch_unwind` is made safe by:
     // - `do_call`, the first argument, can be called with the initial `data_ptr`.
     // - `do_catch`, the second argument, can be called with the `data_ptr` as well.
     // See their safety preconditions for more information
     unsafe {
-        return if intrinsics::r#try(do_call::<F, R>, data_ptr, do_catch::<F, R>) == 0 {
+        return if intrinsics::catch_unwind(do_call::<F, R>, data_ptr, do_catch::<F, R>) == 0 {
             Ok(ManuallyDrop::into_inner(data.r))
         } else {
             Err(ManuallyDrop::into_inner(data.p))
@@ -540,7 +540,7 @@ pub unsafe fn r#try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>>
     // Its must contains a valid `f` (type: F) value that can be use to fill
     // `data.r`.
     //
-    // This function cannot be marked as `unsafe` because `intrinsics::r#try`
+    // This function cannot be marked as `unsafe` because `intrinsics::catch_unwind`
     // expects normal function pointers.
     #[inline]
     fn do_call<F: FnOnce() -> R, R>(data: *mut u8) {
@@ -562,7 +562,7 @@ pub unsafe fn r#try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>>
     // Since this uses `cleanup` it also hinges on a correct implementation of
     // `__rustc_panic_cleanup`.
     //
-    // This function cannot be marked as `unsafe` because `intrinsics::r#try`
+    // This function cannot be marked as `unsafe` because `intrinsics::catch_unwind`
     // expects normal function pointers.
     #[inline]
     #[rustc_nounwind] // `intrinsic::r#try` requires catch fn to be nounwind