Skip to content

Commit

Permalink
Weaken pgrx-pg-sys panic bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
workingjubilee committed Jun 5, 2024
1 parent a9d65af commit e98bb1b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pgrx-pg-sys/src/submodules/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::cell::Cell;
use std::fmt::{Display, Formatter};
use std::hint::unreachable_unchecked;
use std::panic::{
catch_unwind, panic_any, resume_unwind, Location, PanicInfo, RefUnwindSafe, UnwindSafe,
catch_unwind, panic_any, resume_unwind, AssertUnwindSafe, Location, PanicInfo, UnwindSafe,
};

use crate::elog::PgLogLevel;
Expand Down Expand Up @@ -381,9 +381,9 @@ enum GuardAction<R> {
// what we really want is a bound of R: !Drop, but negative bounds don't exist yet
pub unsafe fn pgrx_extern_c_guard<Func, R>(f: Func) -> R
where
Func: FnOnce() -> R + UnwindSafe + RefUnwindSafe,
Func: FnOnce() -> R,
{
match unsafe { run_guarded(f) } {
match unsafe { run_guarded(AssertUnwindSafe(f)) } {
GuardAction::Return(r) => r,
GuardAction::ReThrow => {
extern "C" /* "C-unwind" */ {
Expand All @@ -405,7 +405,7 @@ where
#[inline(never)]
unsafe fn run_guarded<F, R>(f: F) -> GuardAction<R>
where
F: FnOnce() -> R + UnwindSafe + RefUnwindSafe,
F: FnOnce() -> R + UnwindSafe,
{
match catch_unwind(f) {
Ok(v) => GuardAction::Return(v),
Expand Down

0 comments on commit e98bb1b

Please sign in to comment.