diff options
| author | bors <bors@rust-lang.org> | 2024-02-27 00:55:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-02-27 00:55:14 +0000 |
| commit | 71ffdf7ff7ac6df5f9f64de7e780b8345797e8a0 (patch) | |
| tree | ae290c8dcb8654460eff1ca65a6ecafa8caf874d /library/std | |
| parent | 5c786a7fe307acf8b0143e1186c8799840da4095 (diff) | |
| parent | ec5c5b7da8822122325d45625b9978fd3f05d84f (diff) | |
| download | rust-71ffdf7ff7ac6df5f9f64de7e780b8345797e8a0.tar.gz rust-71ffdf7ff7ac6df5f9f64de7e780b8345797e8a0.zip | |
Auto merge of #121655 - matthiaskrgr:rollup-qpx3kks, r=matthiaskrgr
Rollup of 4 pull requests
Successful merges:
- #121598 (rename 'try' intrinsic to 'catch_unwind')
- #121639 (Update books)
- #121648 (Update Vec and String `{from,into}_raw_parts`-family docs)
- #121651 (Properly emit `expected ;` on `#[attr] expr`)
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std')
| -rw-r--r-- | library/std/src/panicking.rs | 8 |
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 |
