pgcentralfoundation / pgrx

Build Postgres Extensions with Rust!
Other
3.42k stars 223 forks source link

Remove `UnwindSafe` bound from `pgrx_extern_c_guard` #1732

Closed workingjubilee closed 3 days ago

workingjubilee commented 4 weeks ago

Our invariants are so complicated and need such special handling that once they are take care of, UnwindSafe adds nothing. The particular example that motivated this: &mut T isn't UnwindSafe because it's easy to witness a broken invariant, not that you will.

See https://github.com/rust-lang/rfcs/pull/3260 for further rationale.

workingjubilee commented 4 weeks ago

Hm.

...I actually just thought of a trivial change that makes the ArgAbi code compile without this, so now I feel slightly silly. :V

...but that's kind of the problem, in a way. It's basically meaningless.

workingjubilee commented 4 weeks ago

@eeeebbbbrrrr In a sense, we do have a need for "unwind safety" in pgrx. However, our invariants are so horribly complicated and need so much special handling that essentially, once they are take care of, UnwindSafe adds nothing. And &mut T isn't UnwindSafe because it's easy to witness a broken invariant, not that you will.

eeeebbbbrrrr commented 4 weeks ago

UnwindSafe adds nothing.

fair.