Skip to content

Commit b3e6b8b

Browse files
hoodmanegitbot
authored and
gitbot
committed
Add support for wasm exception handling to Emscripten target
Gated behind an unstable `-Z emscripten-wasm-eh` flag
1 parent 53d537f commit b3e6b8b

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

panic_unwind/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ libc = { version = "0.2", default-features = false }
2323

2424
[lints.rust.unexpected_cfgs]
2525
level = "warn"
26-
check-cfg = []
26+
check-cfg = ['cfg(emscripten_wasm_eh)']

panic_unwind/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@
2525
// `real_imp` is unused with Miri, so silence warnings.
2626
#![cfg_attr(miri, allow(dead_code))]
2727
#![allow(internal_features)]
28+
#![cfg_attr(not(bootstrap), feature(cfg_emscripten_wasm_eh))]
2829

2930
use alloc::boxed::Box;
3031
use core::any::Any;
3132
use core::panic::PanicPayload;
3233

3334
cfg_if::cfg_if! {
34-
if #[cfg(target_os = "emscripten")] {
35+
if #[cfg(all(target_os = "emscripten", not(emscripten_wasm_eh)))] {
3536
#[path = "emcc.rs"]
3637
mod imp;
3738
} else if #[cfg(target_os = "hermit")] {

unwind/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ system-llvm-libunwind = []
3737

3838
[lints.rust.unexpected_cfgs]
3939
level = "warn"
40-
check-cfg = []
40+
check-cfg = ['cfg(emscripten_wasm_eh)']

unwind/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
#![feature(staged_api)]
55
#![cfg_attr(not(target_env = "msvc"), feature(libc))]
66
#![cfg_attr(
7-
all(target_family = "wasm", not(target_os = "emscripten")),
7+
all(target_family = "wasm", any(not(target_os = "emscripten"), emscripten_wasm_eh)),
88
feature(simd_wasm64, wasm_exception_handling_intrinsics)
99
)]
1010
#![allow(internal_features)]
11+
#![cfg_attr(not(bootstrap), feature(cfg_emscripten_wasm_eh))]
1112

1213
// Force libc to be included even if unused. This is required by many platforms.
1314
#[cfg(not(all(windows, target_env = "msvc")))]

0 commit comments

Comments
 (0)