Skip to content
This repository was archived by the owner on Oct 3, 2025. It is now read-only.

Commit 60bea1e

Browse files
chore: update to rust 2024
Signed-off-by: Henry Gressmann <[email protected]>
1 parent d6493c2 commit 60bea1e

File tree

19 files changed

+71
-113
lines changed

19 files changed

+71
-113
lines changed

Cargo.lock

Lines changed: 39 additions & 79 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ default-members=[".", "crates/tinywasm", "crates/types", "crates/parser"]
44
resolver="2"
55

66
[workspace.dependencies]
7-
wast="225"
8-
wat="1.225"
7+
wast="226"
8+
wat="1.226"
9+
wasmparser={version="0.226", default-features=false}
910
eyre="0.6"
1011
log="0.4"
1112
pretty_env_logger="0.5"
1213
criterion={version="0.5", default-features=false, features=["cargo_bench_support", "rayon"]}
1314

1415
[workspace.package]
1516
version="0.9.0-alpha.0"
16-
rust-version="1.81"
17-
edition="2021"
17+
rust-version="1.85"
18+
edition="2024"
1819
license="MIT OR Apache-2.0"
1920
authors=["Henry Gressmann <[email protected]>"]
2021
repository="https://github.com/explodingcamera/tinywasm"

crates/parser/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repository.workspace=true
99
rust-version.workspace=true
1010

1111
[dependencies]
12-
wasmparser={version="0.225", default-features=false, features=["validate", "features", "simd"]}
12+
wasmparser={workspace=true, features=["validate", "features", "simd"]}
1313
log={workspace=true, optional=true}
1414
tinywasm-types={version="0.9.0-alpha.0", path="../types", default-features=false}
1515

crates/parser/src/conversion.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub(crate) fn convert_module_import(import: wasmparser::Import<'_>) -> Result<Im
9292
ImportKind::Global(GlobalType { mutable: ty.mutable, ty: convert_valtype(&ty.content_type) })
9393
}
9494
wasmparser::TypeRef::Tag(ty) => {
95-
return Err(crate::ParseError::UnsupportedOperator(format!("Unsupported import kind: {ty:?}")))
95+
return Err(crate::ParseError::UnsupportedOperator(format!("Unsupported import kind: {ty:?}")));
9696
}
9797
},
9898
})
@@ -157,7 +157,7 @@ pub(crate) fn convert_module_export(export: wasmparser::Export<'_>) -> Result<Ex
157157
wasmparser::ExternalKind::Memory => ExternalKind::Memory,
158158
wasmparser::ExternalKind::Global => ExternalKind::Global,
159159
wasmparser::ExternalKind::Tag => {
160-
return Err(crate::ParseError::UnsupportedOperator(format!("Unsupported export kind: {:?}", export.kind)))
160+
return Err(crate::ParseError::UnsupportedOperator(format!("Unsupported export kind: {:?}", export.kind)));
161161
}
162162
};
163163

crates/parser/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,12 @@ impl Parser {
7272
component_model: false,
7373
component_model_nested_names: false,
7474
component_model_values: false,
75-
component_model_more_flags: false,
7675
exceptions: false,
7776
gc: false,
7877
memory_control: false,
7978
relaxed_simd: false,
8079
threads: false,
8180
shared_everything_threads: false,
82-
component_model_multiple_returns: false,
8381
legacy_exceptions: false,
8482
component_model_async: false,
8583
};

crates/parser/src/module.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::log::debug;
2-
use crate::{conversion, ParseError, Result};
2+
use crate::{ParseError, Result, conversion};
33
use alloc::string::ToString;
44
use alloc::{boxed::Box, format, vec::Vec};
55
use tinywasm_types::{

crates/parser/src/visit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,11 +531,11 @@ impl<R: WasmModuleResources> wasmparser::VisitSimdOperator<'_> for FunctionBuild
531531

532532
fn visit_i8x16_shuffle(&mut self, lanes: [u8; 16]) -> Self::Output {
533533
self.v128_constants.push(u128::from_le_bytes(lanes));
534-
self.instructions.push(Instruction::I8x16Shuffle(self.v128_constants.len() as u32 - 1).into());
534+
self.instructions.push(Instruction::I8x16Shuffle(self.v128_constants.len() as u32 - 1));
535535
}
536536

537537
fn visit_v128_const(&mut self, value: wasmparser::V128) -> Self::Output {
538538
self.v128_constants.push(value.i128() as u128);
539-
self.instructions.push(Instruction::V128Const(self.v128_constants.len() as u32 - 1).into());
539+
self.instructions.push(Instruction::V128Const(self.v128_constants.len() as u32 - 1));
540540
}
541541
}

crates/tinywasm/Cargo.toml

Lines changed: 1 addition & 1 deletion
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.4.2"}
23+
wasm-testsuite={version="0.4.4"}
2424
indexmap="2.7"
2525
wast={workspace=true}
2626
wat={workspace=true}

crates/tinywasm/benches/argon2id.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use criterion::{criterion_group, criterion_main, Criterion};
1+
use criterion::{Criterion, criterion_group, criterion_main};
22
use eyre::Result;
3-
use tinywasm::{types, ModuleInstance, Store};
3+
use tinywasm::{ModuleInstance, Store, types};
44
use types::TinyWasmModule;
55

66
const WASM: &[u8] = include_bytes!("../../../examples/rust/out/argon2id.opt.wasm");

crates/tinywasm/benches/fibonacci.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use criterion::{criterion_group, criterion_main, Criterion};
1+
use criterion::{Criterion, criterion_group, criterion_main};
22
use eyre::Result;
3-
use tinywasm::{types, ModuleInstance, Store};
3+
use tinywasm::{ModuleInstance, Store, types};
44
use types::TinyWasmModule;
55

66
const WASM: &[u8] = include_bytes!("../../../examples/rust/out/fibonacci.opt.wasm");
@@ -17,8 +17,7 @@ fn fibonacci_to_twasm(module: &TinyWasmModule) -> Result<Vec<u8>> {
1717
}
1818

1919
fn fibonacci_from_twasm(twasm: &[u8]) -> Result<TinyWasmModule> {
20-
let module = TinyWasmModule::from_twasm(&twasm)?;
21-
Ok(module)
20+
Ok(TinyWasmModule::from_twasm(twasm)?)
2221
}
2322

2423
fn fibonacci_run(module: TinyWasmModule, recursive: bool, n: i32) -> Result<()> {

0 commit comments

Comments
 (0)