rust-lang / rust-lang/rfcs

Moving `catch_unwind` to libcore

Open
#2,810 15 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-ffi A-no_std A-panic T-libs
Dominant language
Markdown
Stars
6.6k
Forks
1.7k
Avg merge
16h 14m
Merged PRs (30d)
1

Description

Hi,
I think FFI is a very common thing people do in no-std environments.
a common thing in C/FFI is passing function pointers as callback, this currently cannot happen safely without a catch_unwind wrapper, otherwise it will panic through FFI boundaries.

It looks like the only reason this can't happen is because of the Box in the result Result<R, Box<dyn Any + Send>>. am I right? is there some inherent reason why it can't happen?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by investigating catch_unwind's Result<R, Box<dyn Any + Send>> return type and its compatibility with libcore, no-std environments, and FFI callbacks. Done requires a resolved design for supporting this use case, along with an agreed implementation and tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.