From b35ea538e792df4b35e036ec8b82bb2452088309 Mon Sep 17 00:00:00 2001 From: Michael-F-Bryan Date: Thu, 17 Nov 2022 19:23:22 +0800 Subject: [PATCH 1/3] Bump the MSRV to 1.63 to match derive_arbitrary --- .github/workflows/benchmark.yaml | 2 +- .github/workflows/build.yml | 2 +- .github/workflows/cloudcompiler.yaml | 2 +- .github/workflows/coverage.yaml | 2 +- .github/workflows/documentation.yaml | 2 +- .github/workflows/lint.yaml | 2 +- .github/workflows/test-js.yaml | 2 +- .github/workflows/test-sys.yaml | 2 +- rust-toolchain | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/benchmark.yaml b/.github/workflows/benchmark.yaml index a95994c99b5..24ca8005219 100644 --- a/.github/workflows/benchmark.yaml +++ b/.github/workflows/benchmark.yaml @@ -24,7 +24,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.61 + toolchain: 1.63 - name: Configure cargo data directory # After this point, all cargo registry and crate data is stored in # $GITHUB_WORKSPACE/.cargo_home. This allows us to cache only the files diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 69e911f3791..08d5bb49726 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,7 +100,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.61 + toolchain: 1.63 target: ${{ matrix.target }} - uses: Swatinem/rust-cache@v1 if: matrix.use_sccache != true diff --git a/.github/workflows/cloudcompiler.yaml b/.github/workflows/cloudcompiler.yaml index a296b312fc8..4bd3f1f5c43 100644 --- a/.github/workflows/cloudcompiler.yaml +++ b/.github/workflows/cloudcompiler.yaml @@ -21,7 +21,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.61 + toolchain: 1.63 target: ${{ matrix.target }} - name: Install wasm32-wasi target shell: bash diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 545696a3514..98e07cccfbf 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -21,7 +21,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.61 + toolchain: 1.63 - name: Install LLVM (Linux) run: | curl --proto '=https' --tlsv1.2 -sSf https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz -L -o llvm.tar.xz diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 0096c315dda..ae018dd312d 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -16,7 +16,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.61 + toolchain: 1.63 - name: Install LLVM shell: bash run: | diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 9e3a58101de..60bc17f1b4f 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -18,7 +18,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.61 + toolchain: 1.63 components: rustfmt, clippy - name: Install LLVM (Linux) run: | diff --git a/.github/workflows/test-js.yaml b/.github/workflows/test-js.yaml index f83064f488c..75ba39ca114 100644 --- a/.github/workflows/test-js.yaml +++ b/.github/workflows/test-js.yaml @@ -33,7 +33,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.61 + toolchain: 1.63 - name: Install NodeJS uses: actions/setup-node@v2 diff --git a/.github/workflows/test-sys.yaml b/.github/workflows/test-sys.yaml index 3d37114104f..9808452ce91 100644 --- a/.github/workflows/test-sys.yaml +++ b/.github/workflows/test-sys.yaml @@ -110,7 +110,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.61 + toolchain: 1.63 target: ${{ matrix.target }} - uses: Swatinem/rust-cache@v1 if: matrix.use_sccache != true diff --git a/rust-toolchain b/rust-toolchain index 4213d88dcbf..58e4eb6b299 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.61 +1.63 From 75d5af2e4dad61d1ae23d73f65c5085723561ecb Mon Sep 17 00:00:00 2001 From: Michael-F-Bryan Date: Thu, 17 Nov 2022 19:32:42 +0800 Subject: [PATCH 2/3] Update the CHANGELOG --- CHANGELOG.md | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 859f9fa1e11..b5757496df3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ Looking for changes that affect our C API? See the [C API Changelog](lib/c-api/C ## Changed +- [#3318](https://github.com/wasmerio/wasmer/pull/3318) Bump the Minimum Supported Rust Version (MSRV) to 1.63 + ## Fixed ## 3.0.0-rc.2 - 2022/11/02 @@ -112,8 +114,8 @@ Looking for changes that affect our C API? See the [C API Changelog](lib/c-api/C - [#3035](https://github.com/wasmerio/wasmer/pull/3035) Added a simple "divide by zero" wast test, for #1899, as the trap information are correctly tracked on singlepass now - [#3021](https://github.com/wasmerio/wasmer/pull/3021) Add back missing Aarch64 relocations (needed for llvm compiler) - [#3008](https://github.com/wasmerio/wasmer/pull/3008) Add a new cargo public-api CI check -- [#2941](https://github.com/wasmerio/wasmer/pull/2941) Implementation of WASIX and a fully networking for Web Assembly -- [#2952](https://github.com/wasmerio/wasmer/pull/2952) CI: add make build-wasmer-wasm test +- [#2941](https://github.com/wasmerio/wasmer/pull/2941) Implementation of WASIX and a fully networking for Web Assembly +- [#2952](https://github.com/wasmerio/wasmer/pull/2952) CI: add make build-wasmer-wasm test - [#2982](https://github.com/wasmerio/wasmer/pull/2982) Add a rustfmt.toml file to the repository ### Changed @@ -133,13 +135,13 @@ Looking for changes that affect our C API? See the [C API Changelog](lib/c-api/C - [#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 - [#2892](https://github.com/wasmerio/wasmer/pull/2892) Renamed `get_native_function` to `get_typed_function`, marked former as deprecated. -- [#2976](https://github.com/wasmerio/wasmer/pull/2976) Upgrade enumset minimum version to one that compiles -- [#2974](https://github.com/wasmerio/wasmer/pull/2974) Context api tests -- [#2973](https://github.com/wasmerio/wasmer/pull/2973) Port C API to new Context API -- [#2969](https://github.com/wasmerio/wasmer/pull/2969) Port JS API to new Context API -- [#2966](https://github.com/wasmerio/wasmer/pull/2966) Singlepass nopanic #2966 -- [#2957](https://github.com/wasmerio/wasmer/pull/2957) Enable multi-value handling in Singlepass compiler -- [#2954](https://github.com/wasmerio/wasmer/pull/2954) Some fixes to x86_64 Singlepass compiler, when using atomics +- [#2976](https://github.com/wasmerio/wasmer/pull/2976) Upgrade enumset minimum version to one that compiles +- [#2974](https://github.com/wasmerio/wasmer/pull/2974) Context api tests +- [#2973](https://github.com/wasmerio/wasmer/pull/2973) Port C API to new Context API +- [#2969](https://github.com/wasmerio/wasmer/pull/2969) Port JS API to new Context API +- [#2966](https://github.com/wasmerio/wasmer/pull/2966) Singlepass nopanic #2966 +- [#2957](https://github.com/wasmerio/wasmer/pull/2957) Enable multi-value handling in Singlepass compiler +- [#2954](https://github.com/wasmerio/wasmer/pull/2954) Some fixes to x86_64 Singlepass compiler, when using atomics - [#2953](https://github.com/wasmerio/wasmer/pull/2953) Makefile: add check target - [#2950](https://github.com/wasmerio/wasmer/pull/2950) compiler-cranelift: Fix typo in enum variant - [#2947](https://github.com/wasmerio/wasmer/pull/2947) Converted the WASI js test into a generic stdio test that works for both sys and js versions of wasmer @@ -159,9 +161,9 @@ Looking for changes that affect our C API? See the [C API Changelog](lib/c-api/C - [#2943](https://github.com/wasmerio/wasmer/pull/2943) Fix build error on some archs by using c_char instead of i8 - [#2976](https://github.com/wasmerio/wasmer/pull/2976) Upgrade minimum enumset to one that compiles - [#2988](https://github.com/wasmerio/wasmer/pull/2988) Have make targets install-capi-lib,install-pkgconfig work without building the wasmer binary -- [#2967](https://github.com/wasmerio/wasmer/pull/2967) Fix singlepass on arm64 that was trying to emit a sub opcode with a constant as destination (for #2959) +- [#2967](https://github.com/wasmerio/wasmer/pull/2967) Fix singlepass on arm64 that was trying to emit a sub opcode with a constant as destination (for #2959) - [#2948](https://github.com/wasmerio/wasmer/pull/2948) Fix regression on gen_import_call_trampoline_arm64() -- [#2944](https://github.com/wasmerio/wasmer/pull/2944) Fix duplicate entries in the CHANGELOG +- [#2944](https://github.com/wasmerio/wasmer/pull/2944) Fix duplicate entries in the CHANGELOG ## 2.3.0 - 2022/06/06 From 3a092cf6f93c0a9582baf0567a8cb81a183e2ff4 Mon Sep 17 00:00:00 2001 From: Michael-F-Bryan Date: Thu, 17 Nov 2022 19:33:39 +0800 Subject: [PATCH 3/3] Make "make lint" pass for Rust 1.63 --- lib/cli/src/commands/create_exe.rs | 15 ++++++++--- lib/cli/src/commands/list.rs | 2 +- .../src/translator/func_state.rs | 4 +-- lib/registry/src/config.rs | 14 +++++----- lib/registry/src/lib.rs | 6 ++--- lib/vfs/src/webc_fs.rs | 4 +-- lib/vm/src/store.rs | 8 +++--- lib/vm/src/trap/traphandlers.rs | 8 +++--- lib/wasi-types/src/lib.rs | 3 +++ lib/wasi-types/src/types.rs | 2 -- tests/compilers/config.rs | 2 +- tests/compilers/traps.rs | 26 ++++++------------- tests/compilers/typed_functions.rs | 2 ++ 13 files changed, 48 insertions(+), 48 deletions(-) diff --git a/lib/cli/src/commands/create_exe.rs b/lib/cli/src/commands/create_exe.rs index e2f8d6204d1..49a8e652b7c 100644 --- a/lib/cli/src/commands/create_exe.rs +++ b/lib/cli/src/commands/create_exe.rs @@ -9,6 +9,7 @@ use serde::{Deserialize, Serialize}; #[cfg(feature = "http")] use std::collections::BTreeMap; use std::env; +use std::fmt::Write as _; use std::fs; use std::fs::File; use std::io::prelude::*; @@ -912,7 +913,8 @@ impl CreateExe { for atom_name in atom_names.iter() { let atom_name = Self::normalize_atom_name(atom_name); - c_code_to_instantiate.push_str(&format!( + write!( + c_code_to_instantiate, " wasm_module_t *atom_{atom_name} = wasmer_object_module_new(store, \"{atom_name}\"); @@ -923,11 +925,16 @@ impl CreateExe { return -1; }} " - )); - deallocate_module.push_str(&format!("wasm_module_delete(atom_{atom_name});")); + ) + .unwrap(); + write!(deallocate_module, "wasm_module_delete(atom_{atom_name});").unwrap(); } - c_code_to_instantiate.push_str(&format!("wasm_module_t *module = atom_{atom_to_run};")); + write!( + c_code_to_instantiate, + "wasm_module_t *module = atom_{atom_to_run};" + ) + .unwrap(); WASMER_STATIC_MAIN_C_SOURCE .replace("#define WASI", "#define WASI\r\n#define WASI_PIRITA") diff --git a/lib/cli/src/commands/list.rs b/lib/cli/src/commands/list.rs index 332129b3912..0851d99476b 100644 --- a/lib/cli/src/commands/list.rs +++ b/lib/cli/src/commands/list.rs @@ -36,7 +36,7 @@ impl List { if empty_table { table.add_empty_row(); } - let _ = table.printstd(); + table.printstd(); Ok(()) } diff --git a/lib/compiler-cranelift/src/translator/func_state.rs b/lib/compiler-cranelift/src/translator/func_state.rs index fafa6fe0d30..773ec78105a 100644 --- a/lib/compiler-cranelift/src/translator/func_state.rs +++ b/lib/compiler-cranelift/src/translator/func_state.rs @@ -189,7 +189,7 @@ impl ControlStackFrame { /// Pop values from the value stack so that it is left at the /// input-parameters to an else-block. pub fn truncate_value_stack_to_else_params(&self, stack: &mut Vec) { - debug_assert!(matches!(self, &ControlStackFrame::If { .. })); + debug_assert!(matches!(self, &Self::If { .. })); stack.truncate(self.original_stack_size()); } @@ -202,7 +202,7 @@ impl ControlStackFrame { // block can see the same number of parameters as the consequent block. As a matter of // fact, we need to substract an extra number of parameter values for if blocks. let num_duplicated_params = match self { - &ControlStackFrame::If { + &Self::If { num_param_values, .. } => { debug_assert!(num_param_values <= self.original_stack_size()); diff --git a/lib/registry/src/config.rs b/lib/registry/src/config.rs index ac2c3e2f051..ae606d124aa 100644 --- a/lib/registry/src/config.rs +++ b/lib/registry/src/config.rs @@ -12,7 +12,7 @@ pub static GLOBAL_CONFIG_FILE_NAME: &str = if cfg!(target_os = "wasi") { "wapm.toml" }; -#[derive(Deserialize, Default, Serialize, Debug, PartialEq)] +#[derive(Deserialize, Default, Serialize, Debug, PartialEq, Eq)] pub struct PartialWapmConfig { /// The number of seconds to wait before checking the registry for a new /// version of the package. @@ -41,12 +41,12 @@ pub const fn wax_default_cooldown() -> i32 { 5 * 60 } -#[derive(Deserialize, Serialize, Debug, PartialEq, Default)] +#[derive(Deserialize, Serialize, Debug, PartialEq, Eq, Default)] pub struct Proxy { pub url: Option, } -#[derive(Deserialize, Serialize, Debug, PartialEq, Default)] +#[derive(Deserialize, Serialize, Debug, PartialEq, Eq, Default)] pub struct UpdateNotifications { pub enabled: String, } @@ -57,14 +57,14 @@ pub struct Telemetry { pub enabled: String, } -#[derive(Deserialize, Serialize, Debug, PartialEq, Clone)] +#[derive(Deserialize, Serialize, Debug, PartialEq, Eq, Clone)] #[serde(untagged)] pub enum Registries { Single(Registry), Multi(MultiRegistry), } -#[derive(Deserialize, Serialize, Debug, PartialEq, Clone)] +#[derive(Deserialize, Serialize, Debug, PartialEq, Eq, Clone)] pub struct MultiRegistry { /// Currently active registry pub current: String, @@ -82,7 +82,7 @@ impl Default for Registries { } } -#[derive(Deserialize, Serialize, Debug, PartialEq, Clone)] +#[derive(Deserialize, Serialize, Debug, PartialEq, Eq, Clone)] pub struct Registry { pub url: String, pub token: Option, @@ -278,7 +278,7 @@ impl PartialWapmConfig { pub fn get_folder(test_name: &str) -> Result { let test_dir = std::env::temp_dir().join("test_wasmer").join(test_name); let _ = std::fs::create_dir_all(&test_dir); - Ok(test_dir.to_path_buf()) + Ok(test_dir) } #[cfg(not(test))] diff --git a/lib/registry/src/lib.rs b/lib/registry/src/lib.rs index b50c0a03f86..f1d4b0b34a5 100644 --- a/lib/registry/src/lib.rs +++ b/lib/registry/src/lib.rs @@ -309,7 +309,7 @@ pub fn query_command_from_registry( }) } -#[derive(Debug, Clone, PartialEq, PartialOrd)] +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd)] pub enum QueryPackageError { ErrorSendingQuery(String), NoPackageFound { @@ -329,7 +329,7 @@ impl fmt::Display for QueryPackageError { } } -#[derive(Debug, Clone, PartialEq, PartialOrd)] +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd)] pub enum GetIfPackageHasNewVersionResult { // if version = Some(...) and the ~/.wasmer/checkouts/.../{version} exists, the package is already installed UseLocalAlreadyInstalled { @@ -860,7 +860,7 @@ pub fn test_if_registry_present(registry: &str) -> Result { use graphql_client::GraphQLQuery; let q = TestIfRegistryPresent::build_query(test_if_registry_present::Variables {}); - let _ = crate::graphql::execute_query_modifier_inner_check_json( + crate::graphql::execute_query_modifier_inner_check_json( registry, "", &q, diff --git a/lib/vfs/src/webc_fs.rs b/lib/vfs/src/webc_fs.rs index 8111157b1b5..34402356357 100644 --- a/lib/vfs/src/webc_fs.rs +++ b/lib/vfs/src/webc_fs.rs @@ -23,7 +23,7 @@ where pub memory: Arc, } -impl<'a, T> WebcFileSystem +impl WebcFileSystem where T: std::fmt::Debug + Send + Sync + 'static, T: Deref>, @@ -54,7 +54,7 @@ where pub memory: Arc, } -impl<'a, T> FileOpener for WebCFileOpener +impl FileOpener for WebCFileOpener where T: std::fmt::Debug + Send + Sync + 'static, T: Deref>, diff --git a/lib/vm/src/store.rs b/lib/vm/src/store.rs index 57630f15c02..ea11d0582a9 100644 --- a/lib/vm/src/store.rs +++ b/lib/vm/src/store.rs @@ -261,8 +261,8 @@ impl MaybeInstanceOwned { /// Returns underlying pointer to the VM data. pub fn as_ptr(&self) -> NonNull { match self { - MaybeInstanceOwned::Host(p) => unsafe { NonNull::new_unchecked(p.get()) }, - MaybeInstanceOwned::Instance(p) => *p, + Self::Host(p) => unsafe { NonNull::new_unchecked(p.get()) }, + Self::Instance(p) => *p, } } } @@ -273,12 +273,12 @@ where { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - MaybeInstanceOwned::Host(p) => { + Self::Host(p) => { write!(f, "host(")?; p.as_ref().fmt(f)?; write!(f, ")") } - MaybeInstanceOwned::Instance(p) => { + Self::Instance(p) => { write!(f, "instance(")?; unsafe { p.as_ref().fmt(f)? }; write!(f, ")") diff --git a/lib/vm/src/trap/traphandlers.rs b/lib/vm/src/trap/traphandlers.rs index 2899b5d182b..c065efc5429 100644 --- a/lib/vm/src/trap/traphandlers.rs +++ b/lib/vm/src/trap/traphandlers.rs @@ -829,14 +829,14 @@ enum UnwindReason { impl UnwindReason { fn into_trap(self) -> Trap { match self { - UnwindReason::UserTrap(data) => Trap::User(data), - UnwindReason::LibTrap(trap) => trap, - UnwindReason::WasmTrap { + Self::UserTrap(data) => Trap::User(data), + Self::LibTrap(trap) => trap, + Self::WasmTrap { backtrace, pc, signal_trap, } => Trap::wasm(pc, backtrace, signal_trap), - UnwindReason::Panic(panic) => std::panic::resume_unwind(panic), + Self::Panic(panic) => std::panic::resume_unwind(panic), } } } diff --git a/lib/wasi-types/src/lib.rs b/lib/wasi-types/src/lib.rs index 2e54b95e5f9..037263546b1 100644 --- a/lib/wasi-types/src/lib.rs +++ b/lib/wasi-types/src/lib.rs @@ -1,3 +1,6 @@ +#![doc(html_favicon_url = "https://wasmer.io/images/icons/favicon-32x32.png")] +#![doc(html_logo_url = "https://github.com/wasmerio.png?size=200")] + pub mod types; pub mod wasi; diff --git a/lib/wasi-types/src/types.rs b/lib/wasi-types/src/types.rs index 9eee82f3ef1..157ad333ac3 100644 --- a/lib/wasi-types/src/types.rs +++ b/lib/wasi-types/src/types.rs @@ -1,6 +1,4 @@ #![deny(unused_mut)] -#![doc(html_favicon_url = "https://wasmer.io/images/icons/favicon-32x32.png")] -#![doc(html_logo_url = "https://github.com/wasmerio.png?size=200")] #![allow(non_camel_case_types, clippy::identity_op)] //! Wasmer's WASI types implementation. diff --git a/tests/compilers/config.rs b/tests/compilers/config.rs index 4a3e30d4095..59f90b91811 100644 --- a/tests/compilers/config.rs +++ b/tests/compilers/config.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use wasmer::{CompilerConfig, Features, ModuleMiddleware, Store}; use wasmer_compiler::Engine; -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum Compiler { LLVM, Cranelift, diff --git a/tests/compilers/traps.rs b/tests/compilers/traps.rs index 5c0e6a20d08..d3a244b3e7d 100644 --- a/tests/compilers/traps.rs +++ b/tests/compilers/traps.rs @@ -34,8 +34,7 @@ fn test_trap_return(config: crate::Config) -> Result<()> { let e = run_func .call(&mut store, &[]) - .err() - .expect("error calling function"); + .expect_err("error calling function"); assert_eq!(e.message(), "test 123"); @@ -62,8 +61,7 @@ fn test_trap_trace(config: crate::Config) -> Result<()> { let e = run_func .call(&mut store, &[]) - .err() - .expect("error calling function"); + .expect_err("error calling function"); let trace = e.trace(); assert_eq!(trace.len(), 2); @@ -113,8 +111,7 @@ fn test_trap_trace_cb(config: crate::Config) -> Result<()> { let e = run_func .call(&mut store, &[]) - .err() - .expect("error calling function"); + .expect_err("error calling function"); let trace = e.trace(); println!("Trace {:?}", trace); @@ -148,8 +145,7 @@ fn test_trap_stack_overflow(config: crate::Config) -> Result<()> { let e = run_func .call(&mut store, &[]) - .err() - .expect("error calling function"); + .expect_err("error calling function"); // We specifically don't check the stack trace here: stack traces after // stack overflows are not generally possible due to unreliable unwinding @@ -181,8 +177,7 @@ fn trap_display_pretty(config: crate::Config) -> Result<()> { let e = run_func .call(&mut store, &[]) - .err() - .expect("error calling function"); + .expect_err("error calling function"); assert_eq!( e.to_string(), "\ @@ -236,8 +231,7 @@ fn trap_display_multi_module(config: crate::Config) -> Result<()> { let e = bar2 .call(&mut store, &[]) - .err() - .expect("error calling function"); + .expect_err("error calling function"); assert_eq!( e.to_string(), "\ @@ -433,9 +427,7 @@ fn call_signature_mismatch(config: crate::Config) -> Result<()> { "#; let module = Module::new(&store, &binary)?; - let err = Instance::new(&mut store, &module, &imports! {}) - .err() - .expect("expected error"); + let err = Instance::new(&mut store, &module, &imports! {}).expect_err("expected error"); assert_eq!( format!("{}", err), "\ @@ -461,9 +453,7 @@ fn start_trap_pretty(config: crate::Config) -> Result<()> { "#; let module = Module::new(&store, wat)?; - let err = Instance::new(&mut store, &module, &imports! {}) - .err() - .expect("expected error"); + let err = Instance::new(&mut store, &module, &imports! {}).expect_err("expected error"); assert_eq!( format!("{}", err), diff --git a/tests/compilers/typed_functions.rs b/tests/compilers/typed_functions.rs index c6c09b07272..93fdd6db4d7 100644 --- a/tests/compilers/typed_functions.rs +++ b/tests/compilers/typed_functions.rs @@ -1,3 +1,5 @@ +#![allow(clippy::unnecessary_operation)] // We use x1 multiplies for clarity + use anyhow::Result; use std::convert::Infallible; use std::sync::{Arc, Mutex};