-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Permit unwinding through FFI by default #62603
Conversation
To be clear, this allows extern C functions to unwind and it does not set the |
@RalfJung no, this has no effect on the I believe rust/src/librustc_codegen_llvm/attributes.rs Lines 278 to 286 in 2eb0bc5
|
☔ The latest upstream changes (presumably #63029) made this pull request unmergeable. Please resolve the merge conflicts. |
Rebased. |
Ping from triage: Any updates? @joshtriplett |
A new beta 1.38 has branched -- @joshtriplett what's your preference here? Are we ready to land this on master and then nominate for beta? Or should I do another beta-targeted PR? |
☔ The latest upstream changes (presumably #63627) made this pull request unmergeable. Please resolve the merge conflicts. |
Could you expand this PR to also remove the With that change, I will nominate this for lang-team discussion. |
Ideally, that code (deciding about the LLVM EDIT: Hm, this is odd -- the code tests for EDIT2: Looks like the code here permits a function to unwind if any |
Looks like #48380 repurposed the attribute, but some old users still treat is as basically a boolean. I think |
See #63884 for fixing how we control the |
699b1c2
to
367b793
Compare
📌 Commit 367b793 has been approved by |
Permit unwinding through FFI by default This repeats #62505 for master (Rust 1.38+), as #58794 is not yet resolved. This is a stopgap until a stable alternative is available, like [RFC 2699](rust-lang/rfcs#2699), as long as progress is being made to that end. r? @joshtriplett
☀️ Test successful - checks-azure |
fix nounwind attribute logic With #62603 landed, we no longer add abort-on-panic shims to `extern "C"` functions. However, that means we should also not emit `nounwind` for `extern fn` because we are not actually catching those panics. The comment justifying that `nounwind` in the source is just factually wrong. I also noticed that we annotate `extern` *declarations* (of any ABI) with `nounwind`, which seems wrong? I removed this. Code like mozjpeg (the code that prompted the removal of the abort-on-panic shim) throws a panic from Rust code that enters C code (meaning the `extern "C"` *definition* must not have `nounwind`, or else we got UB), but then the panic bubbles through the C code and re-enters Rust code (meaning the `extern "C"` *declaration* that gets called from the Rust side must not have `nounwind` either). This should be beta-backported if #62603 gets backported.
based on my interpretation of the recent Lang Team meetings (including the one last night), I am going to unilaterally accept this for a beta backport, due to time pressure with a release in two weeks. @joshtriplett shares this interpretation of the lang team meetings. (The other motivating detail is that, the way things are now, if we do not beta-backport this, then we will have breakage that is solely on the current beta, not in stable nor master, which means we'd be scheduling one cycle of breakage.) (I'm pretty sure there was some sort of process failure along the way here that led to a breakdown in our normal procedure, probably due to a conflation of how this PR is semi-coupled with PR #63909, the question of which teams should have been tagged to each PR, etc...) |
[beta] Rollup backports Cherry-picked: - Permit unwinding through FFI by default #62603 - pprust: Do not print spaces before some tokens #63897 - Account for doc comments coming from proc macros without spans #63930 - Support "soft" feature-gating using a lint #64066 - Update xLTO compatibility table in rustc book. #64092 - Include compiler-rt in the source tarball #64240 - Update LLVM submodule #64317 r? @Mark-Simulacrum
This repeats #62505 for master (Rust 1.38+), as #58794 is not yet resolved. This is a stopgap until a stable alternative is available, like RFC 2699, as long as progress is being made to that end.
r? @joshtriplett