Stream: project-ffi-unwind

Topic: Summarizing the RFC


view this post on Zulip Nell Shamrell-Harrington (Jun 23 2020 at 01:19):

Hello all! I'm looking to provide a very brief and very high level summary of https://github.com/rust-lang/rfcs/pull/2945 on this week's "This Week in Rust" podcast. Does this summary sound accurate?

view this post on Zulip BatmanAoD (Kyle Strand) (Jun 23 2020 at 05:42):

Looking forward to the podcast!

This RFC is somewhat more limited than that; it won't provide a way for Rust to actually access an exception object itself thrown by C++, or for C++ to access a panic object. The "C unwind" ABI will simply make it safe to unwind C++ frames with a Rust panic (or Rust frames with a C++ exception), which some crates are already doing even though it is currently undefined behavior. In order to recover from a panic and resume normal execution, the panic must still be caught by Rust, not by C++; similarly, C++ exceptions can only be caught by C++.

Otherwise, that summary seems fairly good, though I'd suggest a few tweaks. We're defining a new ABI string, but not a new ABI per se; also, I would say "throws an exception" rather than "encounters an exception". (You could also combine the first two bullets; it's probably sufficient to define unwinding as "how C++ exceptions and Rust panics are implemented.")

view this post on Zulip Nell Shamrell-Harrington (Jun 23 2020 at 16:29):

That is very helpful, thank you!


Last updated: Jan 26 2022 at 08:02 UTC