Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: Remove panic wrapper #4147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

madsmtm
Copy link
Member

@madsmtm madsmtm commented Feb 27, 2025

This was introduced in #1853, but is unnecessary nowadays after the introduction of extern "C-unwind" unwinding across FFI is safe in Rust (and it was always supported by the CF observer callbacks themselves).

Panicking elsewhere (such as in NSNotificationCenter callbacks or delegate methods) may still lead to an abort, if AppKit tries to catch it with libc++, since Rust panics are not compatible with those. That's "just" a quality-of-implementation detail of current Rust though, not an inherent limitation, and should really be solved upstream.

  • Tested on all platforms changed
  • Added an entry to the changelog module if knowledge of this change could be valuable to users
    • This is an implementation detail, only real change is that the backtrace is a bit shorter.

@madsmtm madsmtm added DS - macos S - maintenance Repaying technical debt labels Feb 27, 2025
@madsmtm madsmtm force-pushed the madsmtm/apple-remove-panic branch from a7d856c to b4f1aee Compare February 27, 2025 01:40
This is unnecessary, unwinding in CF observer callbacks is safe (and is
safe in Rust after the introduction of `extern "C-unwind"`).

Panicking elsewhere (such as in NSNotificationCenter callbacks or
delegate methods) _may_ still lead to an abort, if AppKit tries to catch
it with libc++, since Rust panics are not compatible with those.

That's "just" a quality-of-implementation detail of current Rust though,
not an inherent limitation, and should really be solved upstream.
@madsmtm madsmtm force-pushed the madsmtm/apple-remove-panic branch from b4f1aee to 82021cc Compare March 1, 2025 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DS - macos S - maintenance Repaying technical debt
Development

Successfully merging this pull request may close these issues.

1 participant