Skip to content

Commit 0f3581e

Browse files
chore: update deps, update nightly
Signed-off-by: Henry Gressmann <[email protected]>
1 parent e1b7638 commit 0f3581e

File tree

15 files changed

+63
-47
lines changed

15 files changed

+63
-47
lines changed

Cargo.lock

+18-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ default-members=[".", "crates/tinywasm", "crates/types", "crates/parser"]
44
resolver="2"
55

66
[workspace.dependencies]
7-
wast="229"
8-
wat="1.229"
9-
wasmparser={version="0.229", default-features=false}
7+
wast="230"
8+
wat="1.230"
9+
wasmparser={version="0.230", default-features=false}
1010
eyre="0.6"
1111
log="0.4"
1212
pretty_env_logger="0.5"

crates/cli/src/bin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ fn main() -> Result<()> {
8282

8383
match args.nested {
8484
TinyWasmSubcommand::Run(Run { wasm_file, engine, args, func }) => {
85-
debug!("args: {:?}", args);
85+
debug!("args: {args:?}");
8686

8787
let path = cwd.join(wasm_file.clone());
8888
let module = match wasm_file.ends_with(".wat") {

crates/parser/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ impl Parser {
8383
cm_nested_names: false,
8484
cm_values: false,
8585
cm_error_context: false,
86+
cm_fixed_size_list: false,
87+
cm_gc: false,
8688
};
8789
Validator::new_with_features(features.into())
8890
}

crates/parser/src/module.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl ModuleReader {
125125
self.code_type_addrs = reader.into_iter().map(|f| Ok(f?)).collect::<Result<Vec<_>>>()?;
126126
}
127127
CodeSectionStart { count, range, .. } => {
128-
debug!("Found code section ({} functions)", count);
128+
debug!("Found code section ({count} functions)");
129129
if !self.code.is_empty() {
130130
return Err(ParseError::DuplicateSection("Code section".into()));
131131
}

crates/parser/src/visit.rs

+15
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,21 @@ impl<'a, R: WasmModuleResources> wasmparser::VisitOperator<'a> for FunctionBuild
453453
self.instructions.push(Instruction::RefIsNull);
454454
}
455455

456+
fn visit_typed_select_multi(&mut self, _tys: Vec<wasmparser::ValType>) -> Self::Output {
457+
self.errors.push(crate::ParseError::UnsupportedOperator(
458+
"Typed select with multiple types is not supported".to_string(),
459+
));
460+
461+
// self.instructions.extend(tys.into_iter().map(|ty| match ty {
462+
// wasmparser::ValType::I32 => Instruction::Select32,
463+
// wasmparser::ValType::F32 => Instruction::Select32,
464+
// wasmparser::ValType::I64 => Instruction::Select64,
465+
// wasmparser::ValType::F64 => Instruction::Select64,
466+
// wasmparser::ValType::V128 => Instruction::Select128,
467+
// wasmparser::ValType::Ref(_) => Instruction::SelectRef,
468+
// }));
469+
}
470+
456471
fn visit_typed_select(&mut self, ty: wasmparser::ValType) -> Self::Output {
457472
self.instructions.push(match ty {
458473
wasmparser::ValType::I32 => Instruction::Select32,

crates/tinywasm/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ tinywasm-types={version="0.9.0-alpha.0", path="../types", default-features=false
2020
libm={version="0.2", default-features=false}
2121

2222
[dev-dependencies]
23-
wasm-testsuite={version="0.5.3"}
23+
wasm-testsuite={version="0.5.4"}
2424
indexmap="2.7"
2525
wast={workspace=true}
2626
wat={workspace=true}

crates/tinywasm/src/error.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ impl Display for Error {
211211
impl Display for LinkingError {
212212
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
213213
match self {
214-
Self::UnknownImport { module, name } => write!(f, "unknown import: {}.{}", module, name),
214+
Self::UnknownImport { module, name } => write!(f, "unknown import: {module}.{name}"),
215215
Self::IncompatibleImportType { module, name } => {
216-
write!(f, "incompatible import type: {}.{}", module, name)
216+
write!(f, "incompatible import type: {module}.{name}")
217217
}
218218
}
219219
}

crates/tinywasm/src/func.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl FuncHandle {
3939
// 5. For each value type and the corresponding value, check if types match
4040
if !(func_ty.params.iter().zip(params).enumerate().all(|(_i, (ty, param))| {
4141
if ty != &param.val_type() {
42-
log::error!("param type mismatch at index {}: expected {:?}, got {:?}", _i, ty, param);
42+
log::error!("param type mismatch at index {_i}: expected {ty:?}, got {param:?}");
4343
false
4444
} else {
4545
true

crates/tinywasm/src/instance.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl ModuleInstance {
192192
pub fn exported_memory<'a>(&self, store: &'a mut Store, name: &str) -> Result<MemoryRef<'a>> {
193193
let export = self.export_addr(name).ok_or_else(|| Error::Other(format!("Export not found: {name}")))?;
194194
let ExternVal::Memory(mem_addr) = export else {
195-
return Err(Error::Other(format!("Export is not a memory: {}", name)));
195+
return Err(Error::Other(format!("Export is not a memory: {name}")));
196196
};
197197

198198
self.memory(store, mem_addr)
@@ -202,7 +202,7 @@ impl ModuleInstance {
202202
pub fn exported_memory_mut<'a>(&self, store: &'a mut Store, name: &str) -> Result<MemoryRefMut<'a>> {
203203
let export = self.export_addr(name).ok_or_else(|| Error::Other(format!("Export not found: {name}")))?;
204204
let ExternVal::Memory(mem_addr) = export else {
205-
return Err(Error::Other(format!("Export is not a memory: {}", name)));
205+
return Err(Error::Other(format!("Export is not a memory: {name}")));
206206
};
207207

208208
self.memory_mut(store, mem_addr)

crates/tinywasm/src/store/table.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,7 @@ mod tests {
250250
let elem = table_instance.get(i);
251251
assert!(
252252
elem.is_ok() && matches!(elem.unwrap(), &TableElement::Initialized(_)),
253-
"Element not initialized correctly at index {}",
254-
i
253+
"Element not initialized correctly at index {i}"
255254
);
256255
}
257256
}

crates/tinywasm/tests/host_func_signature_check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ fn proxy_module(func_ty: &FuncType) -> Module {
147147
let params_text = join_surround(params, "param");
148148

149149
let params_gets: String = params.iter().enumerate().fold(String::new(), |mut acc, (num, _)| {
150-
let _ = writeln!(acc, "(local.get {num})", num = num);
150+
let _ = writeln!(acc, "(local.get {num})");
151151
acc
152152
});
153153

crates/tinywasm/tests/testsuite/run.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl ModuleRegistry {
3131
}
3232
}
3333
fn register(&mut self, name: String, addr: ModuleInstanceAddr) {
34-
log::debug!("registering module: {}", name);
34+
log::debug!("registering module: {name}");
3535
self.modules.insert(name.clone(), addr);
3636

3737
self.last_module = Some(addr);
@@ -99,22 +99,22 @@ impl TestSuite {
9999
});
100100

101101
let print_i32 = Extern::typed_func(|_ctx: tinywasm::FuncContext, arg: i32| {
102-
log::debug!("print_i32: {}", arg);
102+
log::debug!("print_i32: {arg}");
103103
Ok(())
104104
});
105105

106106
let print_i64 = Extern::typed_func(|_ctx: tinywasm::FuncContext, arg: i64| {
107-
log::debug!("print_i64: {}", arg);
107+
log::debug!("print_i64: {arg}");
108108
Ok(())
109109
});
110110

111111
let print_f32 = Extern::typed_func(|_ctx: tinywasm::FuncContext, arg: f32| {
112-
log::debug!("print_f32: {}", arg);
112+
log::debug!("print_f32: {arg}");
113113
Ok(())
114114
});
115115

116116
let print_f64 = Extern::typed_func(|_ctx: tinywasm::FuncContext, arg: f64| {
117-
log::debug!("print_f64: {}", arg);
117+
log::debug!("print_f64: {arg}");
118118
Ok(())
119119
});
120120

@@ -148,7 +148,7 @@ impl TestSuite {
148148
.define("spectest", "print_f64_f64", print_f64_f64)?;
149149

150150
for (name, addr) in modules {
151-
log::debug!("registering module: {}", name);
151+
log::debug!("registering module: {name}");
152152
imports.link_module(name, *addr)?;
153153
}
154154

@@ -158,7 +158,7 @@ impl TestSuite {
158158
pub fn run_files<'a>(&mut self, tests: impl IntoIterator<Item = TestFile<'a>>) -> Result<()> {
159159
tests.into_iter().for_each(|group| {
160160
let name = group.name();
161-
println!("running group: {}", name);
161+
println!("running group: {name}");
162162
if self.1.contains(&name.to_string()) {
163163
info!("skipping group: {name}");
164164
self.test_group(&format!("{name} (skipped)"), name);
@@ -217,7 +217,7 @@ impl TestSuite {
217217
.map_err(|e| eyre!("failed to parse wat module: {:?}", try_downcast_panic(e)));
218218

219219
match &result {
220-
Err(err) => debug!("failed to parse module: {:?}", err),
220+
Err(err) => debug!("failed to parse module: {err:?}"),
221221
Ok((name, module)) => module_registry.update_last_module(module.id(), name.clone()),
222222
};
223223

@@ -402,7 +402,7 @@ impl TestSuite {
402402
let args = convert_wastargs(invoke.args)?;
403403
let module = module_registry.get_idx(invoke.module);
404404
exec_fn_instance(module, &mut store, invoke.name, &args).map_err(|e| {
405-
error!("failed to execute function: {:?}", e);
405+
error!("failed to execute function: {e:?}");
406406
e
407407
})?;
408408
Ok(())
@@ -413,7 +413,7 @@ impl TestSuite {
413413
}
414414

415415
AssertReturn { span, exec, results } => {
416-
info!("AssertReturn: {:?}", exec);
416+
info!("AssertReturn: {exec:?}");
417417
let expected = match convert_wastret(results.into_iter()) {
418418
Err(err) => {
419419
test_group.add_result(
@@ -489,11 +489,11 @@ impl TestSuite {
489489

490490
let invoke_name = invoke.name;
491491
let res: Result<Result<()>, _> = catch_unwind_silent(|| {
492-
debug!("invoke: {:?}", invoke);
492+
debug!("invoke: {invoke:?}");
493493
let args = convert_wastargs(invoke.args)?;
494494
let module = module_registry.get_idx(invoke.module);
495495
let outcomes = exec_fn_instance(module, &mut store, invoke.name, &args).map_err(|e| {
496-
error!("failed to execute function: {:?}", e);
496+
error!("failed to execute function: {e:?}");
497497
e
498498
})?;
499499

crates/types/src/archive.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl Display for TwasmError {
3737
TwasmError::InvalidMagic => write!(f, "Invalid twasm: invalid magic number"),
3838
TwasmError::InvalidVersion => write!(f, "Invalid twasm: invalid version"),
3939
TwasmError::InvalidPadding => write!(f, "Invalid twasm: invalid padding"),
40-
TwasmError::InvalidArchive(e) => write!(f, "Invalid twasm: {}", e),
40+
TwasmError::InvalidArchive(e) => write!(f, "Invalid twasm: {e}"),
4141
}
4242
}
4343
}

crates/types/src/value.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub struct FuncRef(Option<FuncAddr>);
3232
impl Debug for ExternRef {
3333
fn fmt(&self, f: &mut alloc::fmt::Formatter<'_>) -> alloc::fmt::Result {
3434
match self.0 {
35-
Some(addr) => write!(f, "extern({:?})", addr),
35+
Some(addr) => write!(f, "extern({addr:?})"),
3636
None => write!(f, "extern(null)"),
3737
}
3838
}
@@ -41,7 +41,7 @@ impl Debug for ExternRef {
4141
impl Debug for FuncRef {
4242
fn fmt(&self, f: &mut alloc::fmt::Formatter<'_>) -> alloc::fmt::Result {
4343
match self.0 {
44-
Some(addr) => write!(f, "func({:?})", addr),
44+
Some(addr) => write!(f, "func({addr:?})"),
4545
None => write!(f, "func(null)"),
4646
}
4747
}

0 commit comments

Comments
 (0)