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
198198run-make/unstable-flag-required/Makefile
199199run-make/use-suggestions-rust-2018/Makefile
200200run-make/used-cdylib-macos/Makefile
201- run-make/wasm-exceptions-nostd/Makefile
202201run-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<'_>) -> ! {
1717 use alloc:: boxed:: Box ;
1818 use alloc:: string:: ToString ;
1919
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) ;
2222 unsafe {
2323 let exception_raw = Box :: into_raw ( exception) ;
2424 wasm_throw ( exception_raw as * mut u8 ) ;
You can’t perform that action at this time.
0 commit comments