A deep technical argument for deprecating Rust's default `panic=unwind` behavior in favor of `panic=abort`. The author, a Rust core contributor, outlines multiple costs of unwinding: it forces all code to handle arbitrary interruption points, increases binary size (up to 10% measured by Fuchsia), limits compiler optimizations, makes the borrow checker more conservative (preventing moves out of `&mut` references), makes unsafe code extremely difficult to write correctly, and makes 'must move' types unworkable. The author notes that most production Rust services already use `panic=abort` or only use unwinding for cleanup rather than true recovery. The proposal is not to remove unwinding entirely (needed for C++ interop and backwards compatibility) but to make it opt-in rather than the default, allowing the borrow checker to be more permissive in unwind-free contexts.

9m read timeFrom smallcultfollowing.com
Post cover image
Table of contents
Unwinding means all code must be able to stop at every pointThe impact of unwinding was supposed to be containedBut it escaped its boundsUnwinding increases binary size and reduces optimization potentialUnwinding puts limits on the borrow checkerUnwinding prevents code from running to completionUnwinding is of course usefulUnwinding is in fact required…but only in narrow placesConclusion
2 Impressions