From 220751a03549e78919c5ab802555e6999347fdb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 4 Jul 2022 16:11:01 +0200 Subject: [PATCH] Remove RuntimeError::raise from public API --- CHANGELOG.md | 1 + lib/api/src/js/trap.rs | 2 +- lib/compiler/src/engine/trap/error.rs | 8 +------- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac39e4d4c9c..1e2a4b2c788 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Looking for changes that affect our C API? See the [C API Changelog](lib/c-api/C ## **Unreleased** ### Changed +- [#3003](https://github.com/wasmerio/wasmer/pull/3003) Remove RuntimeError::raise from public API - [#2946](https://github.com/wasmerio/wasmer/pull/2946) Remove dylib,staticlib engines in favor of a single Universal engine - [#2949](https://github.com/wasmerio/wasmer/pull/2949) Switch back to using custom LLVM builds on CI diff --git a/lib/api/src/js/trap.rs b/lib/api/src/js/trap.rs index 15211c7f750..0d5ca531860 100644 --- a/lib/api/src/js/trap.rs +++ b/lib/api/src/js/trap.rs @@ -64,7 +64,7 @@ impl RuntimeError { /// Raises a custom user Error #[deprecated(since = "2.1.1", note = "return a Result from host functions instead")] - pub fn raise(error: Box) -> ! { + pub(crate) fn raise(error: Box) -> ! { let error = Self::user(error); let js_error: JsValue = error.into(); wasm_bindgen::throw_val(js_error) diff --git a/lib/compiler/src/engine/trap/error.rs b/lib/compiler/src/engine/trap/error.rs index e2c26c031be..76ae212fb41 100644 --- a/lib/compiler/src/engine/trap/error.rs +++ b/lib/compiler/src/engine/trap/error.rs @@ -3,7 +3,7 @@ use backtrace::Backtrace; use std::error::Error; use std::fmt; use std::sync::Arc; -use wasmer_vm::{raise_user_trap, Trap, TrapCode}; +use wasmer_vm::{Trap, TrapCode}; /// A struct representing an aborted instruction execution, with a message /// indicating the cause. @@ -106,12 +106,6 @@ impl RuntimeError { } } - /// Raises a custom user Error - #[deprecated(since = "2.1.1", note = "return a Result from host functions instead")] - pub fn raise(error: Box) -> ! { - unsafe { raise_user_trap(error) } - } - /// Creates a custom user Error. /// /// This error object can be passed through Wasm frames and later retrieved