summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Gressmann <mail@henrygressmann.de>2025-05-06 20:14:50 +0200
committerHenry Gressmann <mail@henrygressmann.de>2025-05-06 20:14:50 +0200
commit0f3581ef8fdb55ad21fdfd132eaefadaec242f85 (patch)
tree2d9140bcadd0ef0c24aed3b397eb03cf5950abc6
parente1b76386b7e323054d5e8844366ebad86bba693e (diff)
chore: update deps, update nightly
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
-rw-r--r--Cargo.lock36
-rw-r--r--Cargo.toml6
-rw-r--r--crates/cli/src/bin.rs2
-rw-r--r--crates/parser/src/lib.rs2
-rw-r--r--crates/parser/src/module.rs2
-rw-r--r--crates/parser/src/visit.rs15
-rw-r--r--crates/tinywasm/Cargo.toml2
-rw-r--r--crates/tinywasm/src/error.rs4
-rw-r--r--crates/tinywasm/src/func.rs2
-rw-r--r--crates/tinywasm/src/instance.rs4
-rw-r--r--crates/tinywasm/src/store/table.rs3
-rw-r--r--crates/tinywasm/tests/host_func_signature_check.rs2
-rw-r--r--crates/tinywasm/tests/testsuite/run.rs24
-rw-r--r--crates/types/src/archive.rs2
-rw-r--r--crates/types/src/value.rs4
15 files changed, 63 insertions, 47 deletions
diff --git a/Cargo.lock b/Cargo.lock
index f194530..d1cbed1 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -268,15 +268,15 @@ dependencies = [
[[package]]
name = "hashbrown"
-version = "0.15.2"
+version = "0.15.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
+checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3"
[[package]]
name = "hermit-abi"
-version = "0.5.0"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fbd780fe5cc30f81464441920d82ac8740e2e46b29a6fad543ddd075229ce37e"
+checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08"
[[package]]
name = "humantime"
@@ -359,9 +359,9 @@ checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
[[package]]
name = "libm"
-version = "0.2.13"
+version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c9627da5196e5d8ed0b0495e61e518847578da83483c37288316d9b2e03a7f72"
+checksum = "a25169bd5913a4b437588a7e3d127cd6e90127b60e0ffbd834a38f1599e016b8"
[[package]]
name = "log"
@@ -552,9 +552,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "2.0.100"
+version = "2.0.101"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0"
+checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf"
dependencies = [
"proc-macro2",
"quote",
@@ -664,9 +664,9 @@ dependencies = [
[[package]]
name = "wasm-encoder"
-version = "0.229.0"
+version = "0.230.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38ba1d491ecacb085a2552025c10a675a6fddcbd03b1fc9b36c536010ce265d2"
+checksum = "d4349d0943718e6e434b51b9639e876293093dca4b96384fb136ab5bd5ce6660"
dependencies = [
"leb128fmt",
"wasmparser",
@@ -674,9 +674,9 @@ dependencies = [
[[package]]
name = "wasm-testsuite"
-version = "0.5.3"
+version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "735333508bfc70a3cc7a7ed86b3cd53e4a775cbf78511eaec8ac4926ed3a0bf7"
+checksum = "77cf162d75d8af40f1e44215c84edd30f895538741c29d1c890249665b310d94"
dependencies = [
"include_dir",
"wast",
@@ -684,9 +684,9 @@ dependencies = [
[[package]]
name = "wasmparser"
-version = "0.229.0"
+version = "0.230.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0cc3b1f053f5d41aa55640a1fa9b6d1b8a9e4418d118ce308d20e24ff3575a8c"
+checksum = "808198a69b5a0535583370a51d459baa14261dfab04800c4864ee9e1a14346ed"
dependencies = [
"bitflags",
"indexmap",
@@ -695,9 +695,9 @@ dependencies = [
[[package]]
name = "wast"
-version = "229.0.0"
+version = "230.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "63fcaff613c12225696bb163f79ca38ffb40e9300eff0ff4b8aa8b2f7eadf0d9"
+checksum = "b8edac03c5fa691551531533928443faf3dc61a44f814a235c7ec5d17b7b34f1"
dependencies = [
"bumpalo",
"leb128fmt",
@@ -708,9 +708,9 @@ dependencies = [
[[package]]
name = "wat"
-version = "1.229.0"
+version = "1.230.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4189bad08b70455a9e9e67dc126d2dcf91fac143a80f1046747a5dde6d4c33e0"
+checksum = "0d77d62229e38db83eac32bacb5f61ebb952366ab0dae90cf2b3c07a65eea894"
dependencies = [
"wast",
]
diff --git a/Cargo.toml b/Cargo.toml
index 1f645cf..198c885 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,9 +4,9 @@ default-members=[".", "crates/tinywasm", "crates/types", "crates/parser"]
resolver="2"
[workspace.dependencies]
-wast="229"
-wat="1.229"
-wasmparser={version="0.229", default-features=false}
+wast="230"
+wat="1.230"
+wasmparser={version="0.230", default-features=false}
eyre="0.6"
log="0.4"
pretty_env_logger="0.5"
diff --git a/crates/cli/src/bin.rs b/crates/cli/src/bin.rs
index 8c0fe93..d00848e 100644
--- a/crates/cli/src/bin.rs
+++ b/crates/cli/src/bin.rs
@@ -82,7 +82,7 @@ fn main() -> Result<()> {
match args.nested {
TinyWasmSubcommand::Run(Run { wasm_file, engine, args, func }) => {
- debug!("args: {:?}", args);
+ debug!("args: {args:?}");
let path = cwd.join(wasm_file.clone());
let module = match wasm_file.ends_with(".wat") {
diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs
index aa33995..f0196b6 100644
--- a/crates/parser/src/lib.rs
+++ b/crates/parser/src/lib.rs
@@ -83,6 +83,8 @@ impl Parser {
cm_nested_names: false,
cm_values: false,
cm_error_context: false,
+ cm_fixed_size_list: false,
+ cm_gc: false,
};
Validator::new_with_features(features.into())
}
diff --git a/crates/parser/src/module.rs b/crates/parser/src/module.rs
index 0e17ad9..3a3becd 100644
--- a/crates/parser/src/module.rs
+++ b/crates/parser/src/module.rs
@@ -125,7 +125,7 @@ impl ModuleReader {
self.code_type_addrs = reader.into_iter().map(|f| Ok(f?)).collect::<Result<Vec<_>>>()?;
}
CodeSectionStart { count, range, .. } => {
- debug!("Found code section ({} functions)", count);
+ debug!("Found code section ({count} functions)");
if !self.code.is_empty() {
return Err(ParseError::DuplicateSection("Code section".into()));
}
diff --git a/crates/parser/src/visit.rs b/crates/parser/src/visit.rs
index 10005c0..1635d2d 100644
--- a/crates/parser/src/visit.rs
+++ b/crates/parser/src/visit.rs
@@ -453,6 +453,21 @@ impl<'a, R: WasmModuleResources> wasmparser::VisitOperator<'a> for FunctionBuild
self.instructions.push(Instruction::RefIsNull);
}
+ fn visit_typed_select_multi(&mut self, _tys: Vec<wasmparser::ValType>) -> Self::Output {
+ self.errors.push(crate::ParseError::UnsupportedOperator(
+ "Typed select with multiple types is not supported".to_string(),
+ ));
+
+ // self.instructions.extend(tys.into_iter().map(|ty| match ty {
+ // wasmparser::ValType::I32 => Instruction::Select32,
+ // wasmparser::ValType::F32 => Instruction::Select32,
+ // wasmparser::ValType::I64 => Instruction::Select64,
+ // wasmparser::ValType::F64 => Instruction::Select64,
+ // wasmparser::ValType::V128 => Instruction::Select128,
+ // wasmparser::ValType::Ref(_) => Instruction::SelectRef,
+ // }));
+ }
+
fn visit_typed_select(&mut self, ty: wasmparser::ValType) -> Self::Output {
self.instructions.push(match ty {
wasmparser::ValType::I32 => Instruction::Select32,
diff --git a/crates/tinywasm/Cargo.toml b/crates/tinywasm/Cargo.toml
index 10a3099..427b45e 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.3"}
+wasm-testsuite={version="0.5.4"}
indexmap="2.7"
wast={workspace=true}
wat={workspace=true}
diff --git a/crates/tinywasm/src/error.rs b/crates/tinywasm/src/error.rs
index 9637521..fcaac1a 100644
--- a/crates/tinywasm/src/error.rs
+++ b/crates/tinywasm/src/error.rs
@@ -211,9 +211,9 @@ impl Display for Error {
impl Display for LinkingError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
- Self::UnknownImport { module, name } => write!(f, "unknown import: {}.{}", module, name),
+ Self::UnknownImport { module, name } => write!(f, "unknown import: {module}.{name}"),
Self::IncompatibleImportType { module, name } => {
- write!(f, "incompatible import type: {}.{}", module, name)
+ write!(f, "incompatible import type: {module}.{name}")
}
}
}
diff --git a/crates/tinywasm/src/func.rs b/crates/tinywasm/src/func.rs
index 2eeabca..642377a 100644
--- a/crates/tinywasm/src/func.rs
+++ b/crates/tinywasm/src/func.rs
@@ -39,7 +39,7 @@ impl FuncHandle {
// 5. For each value type and the corresponding value, check if types match
if !(func_ty.params.iter().zip(params).enumerate().all(|(_i, (ty, param))| {
if ty != &param.val_type() {
- log::error!("param type mismatch at index {}: expected {:?}, got {:?}", _i, ty, param);
+ log::error!("param type mismatch at index {_i}: expected {ty:?}, got {param:?}");
false
} else {
true
diff --git a/crates/tinywasm/src/instance.rs b/crates/tinywasm/src/instance.rs
index eebf5ff..9a0d1e2 100644
--- a/crates/tinywasm/src/instance.rs
+++ b/crates/tinywasm/src/instance.rs
@@ -192,7 +192,7 @@ impl ModuleInstance {
pub fn exported_memory<'a>(&self, store: &'a mut Store, name: &str) -> Result<MemoryRef<'a>> {
let export = self.export_addr(name).ok_or_else(|| Error::Other(format!("Export not found: {name}")))?;
let ExternVal::Memory(mem_addr) = export else {
- return Err(Error::Other(format!("Export is not a memory: {}", name)));
+ return Err(Error::Other(format!("Export is not a memory: {name}")));
};
self.memory(store, mem_addr)
@@ -202,7 +202,7 @@ impl ModuleInstance {
pub fn exported_memory_mut<'a>(&self, store: &'a mut Store, name: &str) -> Result<MemoryRefMut<'a>> {
let export = self.export_addr(name).ok_or_else(|| Error::Other(format!("Export not found: {name}")))?;
let ExternVal::Memory(mem_addr) = export else {
- return Err(Error::Other(format!("Export is not a memory: {}", name)));
+ return Err(Error::Other(format!("Export is not a memory: {name}")));
};
self.memory_mut(store, mem_addr)
diff --git a/crates/tinywasm/src/store/table.rs b/crates/tinywasm/src/store/table.rs
index f83de9b..6192119 100644
--- a/crates/tinywasm/src/store/table.rs
+++ b/crates/tinywasm/src/store/table.rs
@@ -250,8 +250,7 @@ mod tests {
let elem = table_instance.get(i);
assert!(
elem.is_ok() && matches!(elem.unwrap(), &TableElement::Initialized(_)),
- "Element not initialized correctly at index {}",
- i
+ "Element not initialized correctly at index {i}"
);
}
}
diff --git a/crates/tinywasm/tests/host_func_signature_check.rs b/crates/tinywasm/tests/host_func_signature_check.rs
index 698ad61..9389435 100644
--- a/crates/tinywasm/tests/host_func_signature_check.rs
+++ b/crates/tinywasm/tests/host_func_signature_check.rs
@@ -147,7 +147,7 @@ fn proxy_module(func_ty: &FuncType) -> Module {
let params_text = join_surround(params, "param");
let params_gets: String = params.iter().enumerate().fold(String::new(), |mut acc, (num, _)| {
- let _ = writeln!(acc, "(local.get {num})", num = num);
+ let _ = writeln!(acc, "(local.get {num})");
acc
});
diff --git a/crates/tinywasm/tests/testsuite/run.rs b/crates/tinywasm/tests/testsuite/run.rs
index d09efdb..c46a276 100644
--- a/crates/tinywasm/tests/testsuite/run.rs
+++ b/crates/tinywasm/tests/testsuite/run.rs
@@ -31,7 +31,7 @@ impl ModuleRegistry {
}
}
fn register(&mut self, name: String, addr: ModuleInstanceAddr) {
- log::debug!("registering module: {}", name);
+ log::debug!("registering module: {name}");
self.modules.insert(name.clone(), addr);
self.last_module = Some(addr);
@@ -99,22 +99,22 @@ impl TestSuite {
});
let print_i32 = Extern::typed_func(|_ctx: tinywasm::FuncContext, arg: i32| {
- log::debug!("print_i32: {}", arg);
+ log::debug!("print_i32: {arg}");
Ok(())
});
let print_i64 = Extern::typed_func(|_ctx: tinywasm::FuncContext, arg: i64| {
- log::debug!("print_i64: {}", arg);
+ log::debug!("print_i64: {arg}");
Ok(())
});
let print_f32 = Extern::typed_func(|_ctx: tinywasm::FuncContext, arg: f32| {
- log::debug!("print_f32: {}", arg);
+ log::debug!("print_f32: {arg}");
Ok(())
});
let print_f64 = Extern::typed_func(|_ctx: tinywasm::FuncContext, arg: f64| {
- log::debug!("print_f64: {}", arg);
+ log::debug!("print_f64: {arg}");
Ok(())
});
@@ -148,7 +148,7 @@ impl TestSuite {
.define("spectest", "print_f64_f64", print_f64_f64)?;
for (name, addr) in modules {
- log::debug!("registering module: {}", name);
+ log::debug!("registering module: {name}");
imports.link_module(name, *addr)?;
}
@@ -158,7 +158,7 @@ impl TestSuite {
pub fn run_files<'a>(&mut self, tests: impl IntoIterator<Item = TestFile<'a>>) -> Result<()> {
tests.into_iter().for_each(|group| {
let name = group.name();
- println!("running group: {}", name);
+ println!("running group: {name}");
if self.1.contains(&name.to_string()) {
info!("skipping group: {name}");
self.test_group(&format!("{name} (skipped)"), name);
@@ -217,7 +217,7 @@ impl TestSuite {
.map_err(|e| eyre!("failed to parse wat module: {:?}", try_downcast_panic(e)));
match &result {
- Err(err) => debug!("failed to parse module: {:?}", err),
+ Err(err) => debug!("failed to parse module: {err:?}"),
Ok((name, module)) => module_registry.update_last_module(module.id(), name.clone()),
};
@@ -402,7 +402,7 @@ impl TestSuite {
let args = convert_wastargs(invoke.args)?;
let module = module_registry.get_idx(invoke.module);
exec_fn_instance(module, &mut store, invoke.name, &args).map_err(|e| {
- error!("failed to execute function: {:?}", e);
+ error!("failed to execute function: {e:?}");
e
})?;
Ok(())
@@ -413,7 +413,7 @@ impl TestSuite {
}
AssertReturn { span, exec, results } => {
- info!("AssertReturn: {:?}", exec);
+ info!("AssertReturn: {exec:?}");
let expected = match convert_wastret(results.into_iter()) {
Err(err) => {
test_group.add_result(
@@ -489,11 +489,11 @@ impl TestSuite {
let invoke_name = invoke.name;
let res: Result<Result<()>, _> = catch_unwind_silent(|| {
- debug!("invoke: {:?}", invoke);
+ debug!("invoke: {invoke:?}");
let args = convert_wastargs(invoke.args)?;
let module = module_registry.get_idx(invoke.module);
let outcomes = exec_fn_instance(module, &mut store, invoke.name, &args).map_err(|e| {
- error!("failed to execute function: {:?}", e);
+ error!("failed to execute function: {e:?}");
e
})?;
diff --git a/crates/types/src/archive.rs b/crates/types/src/archive.rs
index cbc22ad..b190d43 100644
--- a/crates/types/src/archive.rs
+++ b/crates/types/src/archive.rs
@@ -37,7 +37,7 @@ impl Display for TwasmError {
TwasmError::InvalidMagic => write!(f, "Invalid twasm: invalid magic number"),
TwasmError::InvalidVersion => write!(f, "Invalid twasm: invalid version"),
TwasmError::InvalidPadding => write!(f, "Invalid twasm: invalid padding"),
- TwasmError::InvalidArchive(e) => write!(f, "Invalid twasm: {}", e),
+ TwasmError::InvalidArchive(e) => write!(f, "Invalid twasm: {e}"),
}
}
}
diff --git a/crates/types/src/value.rs b/crates/types/src/value.rs
index a9498cc..b68836b 100644
--- a/crates/types/src/value.rs
+++ b/crates/types/src/value.rs
@@ -32,7 +32,7 @@ pub struct FuncRef(Option<FuncAddr>);
impl Debug for ExternRef {
fn fmt(&self, f: &mut alloc::fmt::Formatter<'_>) -> alloc::fmt::Result {
match self.0 {
- Some(addr) => write!(f, "extern({:?})", addr),
+ Some(addr) => write!(f, "extern({addr:?})"),
None => write!(f, "extern(null)"),
}
}
@@ -41,7 +41,7 @@ impl Debug for ExternRef {
impl Debug for FuncRef {
fn fmt(&self, f: &mut alloc::fmt::Formatter<'_>) -> alloc::fmt::Result {
match self.0 {
- Some(addr) => write!(f, "func({:?})", addr),
+ Some(addr) => write!(f, "func({addr:?})"),
None => write!(f, "func(null)"),
}
}