Skip to content

Commit

Permalink
Rollup merge of rust-lang#121551 - nbdd0121:ffi_unwind, r=RalfJung
Browse files Browse the repository at this point in the history
Forbid use of `extern "C-unwind"` inside standard library

Those libraries are build with `-C panic=unwind` and is expected to be linkable to `-C panic=abort` library. To ensure unsoundness compiler needs to prevent a `C-unwind` call to exist, as doing so may leak foreign exceptions into `-C panic=abort`.

r? `@RalfJung`
  • Loading branch information
matthiaskrgr authored Feb 24, 2024
2 parents 6e5f0c7 + f08e2d4 commit 1f5b171
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions library/alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
#![warn(multiple_supertrait_upcastable)]
#![allow(internal_features)]
#![allow(rustdoc::redundant_explicit_links)]
#![deny(ffi_unwind_calls)]
//
// Library features:
// tidy-alphabetical-start
Expand Down
1 change: 1 addition & 0 deletions library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
#![allow(incomplete_features)]
#![warn(multiple_supertrait_upcastable)]
#![allow(internal_features)]
#![deny(ffi_unwind_calls)]
// Do not check link redundancy on bootstraping phase
#![allow(rustdoc::redundant_explicit_links)]
//
Expand Down
1 change: 1 addition & 0 deletions library/proc_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#![feature(strict_provenance)]
#![recursion_limit = "256"]
#![allow(internal_features)]
#![deny(ffi_unwind_calls)]

#[unstable(feature = "proc_macro_internals", issue = "27812")]
#[doc(hidden)]
Expand Down

0 comments on commit 1f5b171

Please sign in to comment.