summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorHenry Gressmann <mail@henrygressmann.de>2025-04-03 00:52:27 +0200
committerHenry Gressmann <mail@henrygressmann.de>2025-04-03 00:52:27 +0200
commitcdc0015b7752b5404f6edd2777ad62a9eb2e6244 (patch)
treef245fc43d669548a21209f8c05b66ec1908f7742 /crates
parent9b3e8fee9731d1f21fd573b562775a841f7d1209 (diff)
chore: update deps, cargo fmt
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'crates')
-rw-r--r--crates/cli/src/bin.rs2
-rw-r--r--crates/cli/src/wat.rs2
-rw-r--r--crates/parser/src/lib.rs8
-rw-r--r--crates/tinywasm/Cargo.toml2
-rw-r--r--crates/tinywasm/src/interpreter/executor.rs4
-rw-r--r--crates/tinywasm/tests/host_func_signature_check.rs2
-rw-r--r--crates/tinywasm/tests/test-wasm-1.rs2
-rw-r--r--crates/tinywasm/tests/test-wasm-2.rs2
-rw-r--r--crates/tinywasm/tests/test-wasm-3.rs2
-rw-r--r--crates/tinywasm/tests/test-wasm-annotations.rs2
-rw-r--r--crates/tinywasm/tests/test-wasm-extended-const.rs2
-rw-r--r--crates/tinywasm/tests/test-wasm-multi-memory.rs2
-rw-r--r--crates/tinywasm/tests/test-wasm-relaxed-simd.rs2
-rw-r--r--crates/tinywasm/tests/test-wast.rs2
-rw-r--r--crates/tinywasm/tests/testsuite/mod.rs2
-rw-r--r--crates/tinywasm/tests/testsuite/run.rs4
-rw-r--r--crates/tinywasm/tests/testsuite/util.rs14
17 files changed, 29 insertions, 27 deletions
diff --git a/crates/cli/src/bin.rs b/crates/cli/src/bin.rs
index 6efbba1..8c0fe93 100644
--- a/crates/cli/src/bin.rs
+++ b/crates/cli/src/bin.rs
@@ -4,7 +4,7 @@ use argh::FromArgs;
use args::WasmArg;
use eyre::Result;
use log::{debug, info};
-use tinywasm::{types::WasmValue, Module};
+use tinywasm::{Module, types::WasmValue};
use crate::args::to_wasm_args;
mod args;
diff --git a/crates/cli/src/wat.rs b/crates/cli/src/wat.rs
index fd00a8e..8d2998d 100644
--- a/crates/cli/src/wat.rs
+++ b/crates/cli/src/wat.rs
@@ -1,6 +1,6 @@
use wast::{
- parser::{self, ParseBuffer},
Wat,
+ parser::{self, ParseBuffer},
};
pub fn wat2wasm(wat: &str) -> Vec<u8> {
diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs
index e5022c5..1292fa6 100644
--- a/crates/parser/src/lib.rs
+++ b/crates/parser/src/lib.rs
@@ -70,8 +70,6 @@ impl Parser {
gc_types: true,
stack_switching: false,
component_model: false,
- component_model_nested_names: false,
- component_model_values: false,
exceptions: false,
gc: false,
memory_control: false,
@@ -79,7 +77,11 @@ impl Parser {
threads: false,
shared_everything_threads: false,
legacy_exceptions: false,
- component_model_async: false,
+ cm_async: false,
+ cm_async_builtins: false,
+ cm_async_stackful: false,
+ cm_nested_names: false,
+ cm_values: false,
};
Validator::new_with_features(features.into())
}
diff --git a/crates/tinywasm/Cargo.toml b/crates/tinywasm/Cargo.toml
index 8af013d..5810f0e 100644
--- a/crates/tinywasm/Cargo.toml
+++ b/crates/tinywasm/Cargo.toml
@@ -20,7 +20,7 @@ tinywasm-types={version="0.9.0-alpha.0", path="../types", default-features=false
libm={version="0.2", default-features=false}
[dev-dependencies]
-wasm-testsuite={version="0.5.0"}
+wasm-testsuite={version="0.5.2"}
indexmap="2.7"
wast={workspace=true}
wat={workspace=true}
diff --git a/crates/tinywasm/src/interpreter/executor.rs b/crates/tinywasm/src/interpreter/executor.rs
index d6d8089..a0153af 100644
--- a/crates/tinywasm/src/interpreter/executor.rs
+++ b/crates/tinywasm/src/interpreter/executor.rs
@@ -440,12 +440,12 @@ impl<'store, 'stack> Executor<'store, 'stack> {
I8x16Shl => self.stack.values.calculate_diff::<i32, i8x16, i8x16>(|a, b| Ok(b.shl(a as i8))).to_cf()?,
I16x8Shl => self.stack.values.calculate_diff::<i32, i16x8, i16x8>(|a, b| Ok(b.shl(a as i16))).to_cf()?,
- I32x4Shl => self.stack.values.calculate_diff::<i32, i32x4, i32x4>(|a, b| Ok(b.shl(a as i32))).to_cf()?,
+ I32x4Shl => self.stack.values.calculate_diff::<i32, i32x4, i32x4>(|a, b| Ok(b.shl(a))).to_cf()?,
I64x2Shl => self.stack.values.calculate_diff::<i32, i64x2, i64x2>(|a, b| Ok(b.shl(a as i64))).to_cf()?,
I8x16ShrS => self.stack.values.calculate_diff::<i32, i8x16, i8x16>(|a, b| Ok(b.shr(a as i8))).to_cf()?,
I16x8ShrS => self.stack.values.calculate_diff::<i32, i16x8, i16x8>(|a, b| Ok(b.shr(a as i16))).to_cf()?,
- I32x4ShrS => self.stack.values.calculate_diff::<i32, i32x4, i32x4>(|a, b| Ok(b.shr(a as i32))).to_cf()?,
+ I32x4ShrS => self.stack.values.calculate_diff::<i32, i32x4, i32x4>(|a, b| Ok(b.shr(a))).to_cf()?,
I64x2ShrS => self.stack.values.calculate_diff::<i32, i64x2, i64x2>(|a, b| Ok(b.shr(a as i64))).to_cf()?,
I8x16ShrU => self.stack.values.calculate_diff::<i32, u8x16, u8x16>(|a, b| Ok(b.shr(a as u8))).to_cf()?,
diff --git a/crates/tinywasm/tests/host_func_signature_check.rs b/crates/tinywasm/tests/host_func_signature_check.rs
index c60ade2..698ad61 100644
--- a/crates/tinywasm/tests/host_func_signature_check.rs
+++ b/crates/tinywasm/tests/host_func_signature_check.rs
@@ -1,8 +1,8 @@
use eyre::Result;
use std::fmt::Write;
use tinywasm::{
- types::{FuncType, ValType, WasmValue},
Extern, FuncContext, Imports, Module, Store,
+ types::{FuncType, ValType, WasmValue},
};
use tinywasm_types::ExternRef;
diff --git a/crates/tinywasm/tests/test-wasm-1.rs b/crates/tinywasm/tests/test-wasm-1.rs
index 94c83f9..be235ae 100644
--- a/crates/tinywasm/tests/test-wasm-1.rs
+++ b/crates/tinywasm/tests/test-wasm-1.rs
@@ -1,7 +1,7 @@
mod testsuite;
use eyre::Result;
use testsuite::TestSuite;
-use wasm_testsuite::data::{spec, SpecVersion};
+use wasm_testsuite::data::{SpecVersion, spec};
fn main() -> Result<()> {
TestSuite::set_log_level(log::LevelFilter::Off);
diff --git a/crates/tinywasm/tests/test-wasm-2.rs b/crates/tinywasm/tests/test-wasm-2.rs
index 9b30ac0..0379ca6 100644
--- a/crates/tinywasm/tests/test-wasm-2.rs
+++ b/crates/tinywasm/tests/test-wasm-2.rs
@@ -1,7 +1,7 @@
mod testsuite;
use eyre::Result;
use testsuite::TestSuite;
-use wasm_testsuite::data::{spec, SpecVersion};
+use wasm_testsuite::data::{SpecVersion, spec};
fn main() -> Result<()> {
TestSuite::set_log_level(log::LevelFilter::Off);
diff --git a/crates/tinywasm/tests/test-wasm-3.rs b/crates/tinywasm/tests/test-wasm-3.rs
index a0e2543..3e63dc5 100644
--- a/crates/tinywasm/tests/test-wasm-3.rs
+++ b/crates/tinywasm/tests/test-wasm-3.rs
@@ -1,7 +1,7 @@
mod testsuite;
use eyre::Result;
use testsuite::TestSuite;
-use wasm_testsuite::data::{spec, SpecVersion};
+use wasm_testsuite::data::{SpecVersion, spec};
fn main() -> Result<()> {
if !std::env::args().any(|x| &x == "--enable") {
diff --git a/crates/tinywasm/tests/test-wasm-annotations.rs b/crates/tinywasm/tests/test-wasm-annotations.rs
index 3170241..beac9eb 100644
--- a/crates/tinywasm/tests/test-wasm-annotations.rs
+++ b/crates/tinywasm/tests/test-wasm-annotations.rs
@@ -1,7 +1,7 @@
mod testsuite;
use eyre::Result;
use testsuite::TestSuite;
-use wasm_testsuite::data::{proposal, Proposal};
+use wasm_testsuite::data::{Proposal, proposal};
fn main() -> Result<()> {
TestSuite::set_log_level(log::LevelFilter::Off);
diff --git a/crates/tinywasm/tests/test-wasm-extended-const.rs b/crates/tinywasm/tests/test-wasm-extended-const.rs
index 7c9a304..888a49f 100644
--- a/crates/tinywasm/tests/test-wasm-extended-const.rs
+++ b/crates/tinywasm/tests/test-wasm-extended-const.rs
@@ -1,7 +1,7 @@
mod testsuite;
use eyre::Result;
use testsuite::TestSuite;
-use wasm_testsuite::data::{proposal, Proposal};
+use wasm_testsuite::data::{Proposal, proposal};
fn main() -> Result<()> {
TestSuite::set_log_level(log::LevelFilter::Off);
diff --git a/crates/tinywasm/tests/test-wasm-multi-memory.rs b/crates/tinywasm/tests/test-wasm-multi-memory.rs
index d491fb1..30052b0 100644
--- a/crates/tinywasm/tests/test-wasm-multi-memory.rs
+++ b/crates/tinywasm/tests/test-wasm-multi-memory.rs
@@ -1,7 +1,7 @@
mod testsuite;
use eyre::Result;
use testsuite::TestSuite;
-use wasm_testsuite::data::{proposal, Proposal};
+use wasm_testsuite::data::{Proposal, proposal};
fn main() -> Result<()> {
TestSuite::set_log_level(log::LevelFilter::Off);
diff --git a/crates/tinywasm/tests/test-wasm-relaxed-simd.rs b/crates/tinywasm/tests/test-wasm-relaxed-simd.rs
index 7af830a..0851d18 100644
--- a/crates/tinywasm/tests/test-wasm-relaxed-simd.rs
+++ b/crates/tinywasm/tests/test-wasm-relaxed-simd.rs
@@ -1,7 +1,7 @@
mod testsuite;
use eyre::Result;
use testsuite::TestSuite;
-use wasm_testsuite::data::{proposal, Proposal};
+use wasm_testsuite::data::{Proposal, proposal};
fn main() -> Result<()> {
TestSuite::set_log_level(log::LevelFilter::Off);
diff --git a/crates/tinywasm/tests/test-wast.rs b/crates/tinywasm/tests/test-wast.rs
index 33c716c..40b0e04 100644
--- a/crates/tinywasm/tests/test-wast.rs
+++ b/crates/tinywasm/tests/test-wast.rs
@@ -1,6 +1,6 @@
use std::path::PathBuf;
-use eyre::{bail, eyre, Result};
+use eyre::{Result, bail, eyre};
use owo_colors::OwoColorize;
use testsuite::TestSuite;
diff --git a/crates/tinywasm/tests/testsuite/mod.rs b/crates/tinywasm/tests/testsuite/mod.rs
index ee0336e..c1ba46e 100644
--- a/crates/tinywasm/tests/testsuite/mod.rs
+++ b/crates/tinywasm/tests/testsuite/mod.rs
@@ -1,5 +1,5 @@
#![allow(unused)]
-use eyre::{eyre, Result};
+use eyre::{Result, eyre};
use indexmap::IndexMap;
use owo_colors::OwoColorize;
use std::io::{BufRead, Seek, SeekFrom};
diff --git a/crates/tinywasm/tests/testsuite/run.rs b/crates/tinywasm/tests/testsuite/run.rs
index 0804266..d09efdb 100644
--- a/crates/tinywasm/tests/testsuite/run.rs
+++ b/crates/tinywasm/tests/testsuite/run.rs
@@ -2,14 +2,14 @@ use crate::testsuite::util::*;
use std::{borrow::Cow, collections::HashMap, fs::canonicalize, path::PathBuf};
use super::TestSuite;
-use eyre::{eyre, Result};
+use eyre::{Result, eyre};
use indexmap::IndexMap;
use log::{debug, error, info};
use tinywasm::{Extern, Imports, ModuleInstance};
use tinywasm_types::{ExternVal, MemoryType, ModuleInstanceAddr, TableType, ValType, WasmValue};
use wasm_testsuite::data::TestFile;
use wasm_testsuite::wast;
-use wasm_testsuite::wast::{lexer::Lexer, parser::ParseBuffer, Wast};
+use wasm_testsuite::wast::{Wast, lexer::Lexer, parser::ParseBuffer};
#[derive(Default)]
struct ModuleRegistry {
diff --git a/crates/tinywasm/tests/testsuite/util.rs b/crates/tinywasm/tests/testsuite/util.rs
index 91a1e41..5e8558a 100644
--- a/crates/tinywasm/tests/testsuite/util.rs
+++ b/crates/tinywasm/tests/testsuite/util.rs
@@ -102,7 +102,7 @@ fn wastarg2tinywasmvalue(arg: wast::WastArg) -> Result<tinywasm_types::WasmValue
F64(f) => WasmValue::F64(f64::from_bits(f.bits)),
I32(i) => WasmValue::I32(i),
I64(i) => WasmValue::I64(i),
- V128(i) => WasmValue::V128(i128::from_le_bytes(i.to_le_bytes()).try_into().unwrap()),
+ V128(i) => WasmValue::V128(i128::from_le_bytes(i.to_le_bytes())),
RefExtern(v) => WasmValue::RefExtern(ExternRef::new(Some(v))),
RefNull(t) => match t {
wast::core::HeapType::Abstract { shared: false, ty: AbstractHeapType::Func } => {
@@ -120,15 +120,15 @@ fn wastarg2tinywasmvalue(arg: wast::WastArg) -> Result<tinywasm_types::WasmValue
fn wast_i128_to_i128(i: wast::core::V128Pattern) -> i128 {
let res: Vec<u8> = match i {
wast::core::V128Pattern::F32x4(f) => {
- f.iter().map(|v| nanpattern2tinywasmvalue(*v).unwrap().as_f32().unwrap().to_le_bytes()).flatten().collect()
+ f.iter().flat_map(|v| nanpattern2tinywasmvalue(*v).unwrap().as_f32().unwrap().to_le_bytes()).collect()
}
wast::core::V128Pattern::F64x2(f) => {
- f.iter().map(|v| nanpattern2tinywasmvalue(*v).unwrap().as_f64().unwrap().to_le_bytes()).flatten().collect()
+ f.iter().flat_map(|v| nanpattern2tinywasmvalue(*v).unwrap().as_f64().unwrap().to_le_bytes()).collect()
}
- wast::core::V128Pattern::I16x8(f) => f.iter().map(|v| v.to_le_bytes()).flatten().collect(),
- wast::core::V128Pattern::I32x4(f) => f.iter().map(|v| v.to_le_bytes()).flatten().collect(),
- wast::core::V128Pattern::I64x2(f) => f.iter().map(|v| v.to_le_bytes()).flatten().collect(),
- wast::core::V128Pattern::I8x16(f) => f.iter().map(|v| v.to_le_bytes()).flatten().collect(),
+ wast::core::V128Pattern::I16x8(f) => f.iter().flat_map(|v| v.to_le_bytes()).collect(),
+ wast::core::V128Pattern::I32x4(f) => f.iter().flat_map(|v| v.to_le_bytes()).collect(),
+ wast::core::V128Pattern::I64x2(f) => f.iter().flat_map(|v| v.to_le_bytes()).collect(),
+ wast::core::V128Pattern::I8x16(f) => f.iter().flat_map(|v| v.to_le_bytes()).collect(),
};
i128::from_le_bytes(res.try_into().unwrap())