This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 8341f42
move new c abi abort behavior behind feature gate
### Background
In rust-lang#76570, new ABI strings including `C-unwind` were introduced.
Their behavior is specified in RFC 2945 [1].
However, it was reported in the #ffi-unwind stream of the Rust
community Zulip that this had altered the way that `extern "C"`
functions behaved even when the `c_unwind` feature gate was not
active. [2]
### Overview
This makes a small patch to
`rustc_mir_build::build::should_abort_on_panic`, so that the same
behavior from before is in place when the `c_unwind` gate is not
active.
`rustc_middle::ty::layout::fn_can_unwind` is not touched, as the
visible behavior should not differ before/after rust-lang#76570. [3]
### Footnotes
[1]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md
[2]: https://rust-lang.zulipchat.com/#narrow/stream/210922-project-ffi-unwind/topic/Is.20unwinding.20through.20extern.20C.20UB.3F/near/230112325
[3]: https://github.com/rust-lang/rust/pull/76570/files#diff-b0320c2b8868f325d83c027fc5d71732636e9763551e35895488f30fe057c6e9L2599-R26171 parent f97769a commit 8341f42
1 file changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
579 | 579 | | |
580 | 580 | | |
581 | 581 | | |
582 | | - | |
| 582 | + | |
583 | 583 | | |
584 | 584 | | |
585 | 585 | | |
| |||
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
612 | 616 | | |
613 | 617 | | |
614 | 618 | | |
| |||
0 commit comments