@@ -173,32 +173,3 @@ pub fn f64_nearest(a: f64) -> f64 {
173173pub fn f64_sqrt ( a : f64 ) -> f64 {
174174 crate :: intrinsics:: sqrtf64 ( a)
175175}
176-
177- unsafe extern "C-unwind" {
178- #[ link_name = "llvm.wasm.throw" ]
179- fn wasm_throw ( tag : i32 , ptr : * mut u8 ) -> !;
180- }
181-
182- /// Generates the [`throw`] instruction from the [exception-handling proposal] for WASM.
183- ///
184- /// This function is unlikely to be stabilized until codegen backends have better support.
185- ///
186- /// [`throw`]: https://webassembly.github.io/exception-handling/core/syntax/instructions.html#syntax-instr-control
187- /// [exception-handling proposal]: https://github.com/WebAssembly/exception-handling
188- #[ cfg_attr( test, assert_instr( throw, TAG = 0 , ptr = core:: ptr:: null_mut( ) ) ) ]
189- #[ inline]
190- #[ unstable( feature = "wasm_exception_handling_intrinsics" , issue = "122465" ) ]
191- // FIXME: Since this instruction unwinds, `core` built with `-C panic=unwind`
192- // cannot be linked with `-C panic=abort` programs. But that's not
193- // entirely supported anyway, because runtimes without EH support won't
194- // be able to handle `try` blocks in `-C panic=unwind` crates either.
195- // We ship `-C panic=abort` `core`, so this doesn't affect users
196- // directly. Resolving this will likely require patching out both `try`
197- // and `throw` instructions, at which point we can look into whitelisting
198- // this function in the compiler to allow linking.
199- // See https://github.com/rust-lang/rust/issues/118168.
200- #[ allow( ffi_unwind_calls) ]
201- pub unsafe fn throw < const TAG : i32 > ( ptr : * mut u8 ) -> ! {
202- static_assert ! ( TAG == 0 ) ; // LLVM only supports tag 0 == C++ right now.
203- wasm_throw ( TAG , ptr)
204- }
0 commit comments