This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +20
-15
lines changed
tests/run-make/wasm-exceptions-nostd Expand file tree Collapse file tree 4 files changed +20
-15
lines changed Original file line number Diff line number Diff line change @@ -198,5 +198,4 @@ run-make/unknown-mod-stdin/Makefile
198
198
run-make/unstable-flag-required/Makefile
199
199
run-make/use-suggestions-rust-2018/Makefile
200
200
run-make/used-cdylib-macos/Makefile
201
- run-make/wasm-exceptions-nostd/Makefile
202
201
run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ //@ only-wasm32-bare
2
+
3
+ use std:: path:: Path ;
4
+
5
+ use run_make_support:: { cmd, env_var, rustc} ;
6
+
7
+ fn main ( ) {
8
+ // Add a few command line args to make exceptions work
9
+ rustc ( )
10
+ . input ( Path :: new ( "src" ) . join ( "lib.rs" ) )
11
+ . target ( "wasm32-unknown-unknown" )
12
+ . panic ( "unwind" )
13
+ . arg ( "-Cllvm-args=-wasm-enable-eh" )
14
+ . arg ( "-Ctarget-feature=+exception-handling" )
15
+ . run ( ) ;
16
+
17
+ cmd ( & env_var ( "NODE" ) ) . arg ( "verify.mjs" ) . arg ( "lib.wasm" ) . run ( ) ;
18
+ }
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ fn panic_handler(info: &core::panic::PanicInfo<'_>) -> ! {
17
17
use alloc:: boxed:: Box ;
18
18
use alloc:: string:: ToString ;
19
19
20
- let msg = info. message ( ) . map ( |msg| msg . to_string ( ) ) . unwrap_or ( "(no message)" . to_string ( ) ) ;
21
- let exception = Box :: new ( msg. to_string ( ) ) ;
20
+ let msg = info. message ( ) . to_string ( ) ;
21
+ let exception = Box :: new ( msg) ;
22
22
unsafe {
23
23
let exception_raw = Box :: into_raw ( exception) ;
24
24
wasm_throw ( exception_raw as * mut u8 ) ;
You can’t perform that action at this time.
0 commit comments