From 867641d2c89ebfa60886dbf789b3bc39536033fe Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Wed, 31 Jan 2024 09:45:34 -0500 Subject: [PATCH] update (#260) --- Cargo.toml | 2 +- crates/fuzz-utils/Cargo.toml | 2 +- crates/tests/Cargo.toml | 4 ++-- crates/tests/tests/round_trip/elem-segments-1.wat | 2 +- crates/tests/tests/round_trip/elem-segments-2.wat | 2 +- crates/tests/tests/round_trip/elem-segments-3.wat | 2 +- crates/tests/tests/round_trip/gc_keep_used_tables.wat | 2 +- crates/tests/tests/round_trip/gc_unused_tables.wat | 2 +- crates/tests/tests/round_trip/import-gc.wat | 2 +- crates/tests/tests/round_trip/import-table.wat | 2 +- crates/tests/tests/round_trip/keep-elem-segments.wat | 2 +- crates/tests/tests/round_trip/table-init.wast | 2 +- crates/tests/tests/valid/const.wat | 2 +- crates/tests/tests/valid/inc.wat | 2 +- src/error.rs | 1 - src/module/custom.rs | 4 +--- src/module/exports.rs | 2 +- 17 files changed, 17 insertions(+), 20 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6caee8e5..bb3c7d78 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ leb128 = "0.2.4" log = "0.4.8" rayon = { version = "1.1.0", optional = true } walrus-macro = { path = './crates/macro', version = '=0.19.0' } -wasm-encoder = "0.38.1" +wasm-encoder = "0.41.0" wasmparser = "0.80.2" gimli = "0.26.0" diff --git a/crates/fuzz-utils/Cargo.toml b/crates/fuzz-utils/Cargo.toml index bb932337..e945261f 100644 --- a/crates/fuzz-utils/Cargo.toml +++ b/crates/fuzz-utils/Cargo.toml @@ -10,7 +10,7 @@ anyhow = "1.0" env_logger = "0.8.1" rand = { version = "0.7.0", features = ['small_rng'] } tempfile = "3.1.0" -wasmparser = "0.67" +wasmparser = "0.80.2" wat = "1.0" [dependencies.walrus] diff --git a/crates/tests/Cargo.toml b/crates/tests/Cargo.toml index 2b2b634b..db8cee95 100644 --- a/crates/tests/Cargo.toml +++ b/crates/tests/Cargo.toml @@ -16,8 +16,8 @@ serde_json = { version = "1.0.40", features = ['preserve_order'] } tempfile = "3.1.0" walrus = { path = "../.." } walrus-tests-utils = { path = "../tests-utils" } -wasmprinter = "=0.2.59" -wat = "1.0.36" +wasmprinter = "=0.2.78" +wat = "1.0.85" [features] parallel = ['walrus/parallel'] diff --git a/crates/tests/tests/round_trip/elem-segments-1.wat b/crates/tests/tests/round_trip/elem-segments-1.wat index bced4f54..6a3cc1d8 100644 --- a/crates/tests/tests/round_trip/elem-segments-1.wat +++ b/crates/tests/tests/round_trip/elem-segments-1.wat @@ -1,5 +1,5 @@ (module - (table 1 anyfunc) + (table 1 funcref) (func) (elem (i32.const 1) 0) (export "foo" (table 0)) diff --git a/crates/tests/tests/round_trip/elem-segments-2.wat b/crates/tests/tests/round_trip/elem-segments-2.wat index e40c42b2..116c0f95 100644 --- a/crates/tests/tests/round_trip/elem-segments-2.wat +++ b/crates/tests/tests/round_trip/elem-segments-2.wat @@ -1,5 +1,5 @@ (module - (table 1 anyfunc) + (table 1 funcref) (func) (elem (i32.const 1) 0) (elem (i32.const 2) 0) diff --git a/crates/tests/tests/round_trip/elem-segments-3.wat b/crates/tests/tests/round_trip/elem-segments-3.wat index d4692056..cb554a97 100644 --- a/crates/tests/tests/round_trip/elem-segments-3.wat +++ b/crates/tests/tests/round_trip/elem-segments-3.wat @@ -1,5 +1,5 @@ (module - (table 1 anyfunc) + (table 1 funcref) (func) (elem (i32.const 1) 0) (elem (i32.const 3) 0) diff --git a/crates/tests/tests/round_trip/gc_keep_used_tables.wat b/crates/tests/tests/round_trip/gc_keep_used_tables.wat index a4821af6..0da22854 100644 --- a/crates/tests/tests/round_trip/gc_keep_used_tables.wat +++ b/crates/tests/tests/round_trip/gc_keep_used_tables.wat @@ -2,7 +2,7 @@ (module (type (;0;) (func (result i32))) - (table 1 1 anyfunc) + (table 1 1 funcref) (export "t" (table 0))) (; CHECK-ALL: diff --git a/crates/tests/tests/round_trip/gc_unused_tables.wat b/crates/tests/tests/round_trip/gc_unused_tables.wat index 8345aa08..08b7a318 100644 --- a/crates/tests/tests/round_trip/gc_unused_tables.wat +++ b/crates/tests/tests/round_trip/gc_unused_tables.wat @@ -2,7 +2,7 @@ (module (type (;0;) (func (result i32))) - (table 1 1 anyfunc) + (table 1 1 funcref) (func $f (type 0) (result i32) i32.const 42) (export "f" (func $f))) diff --git a/crates/tests/tests/round_trip/import-gc.wat b/crates/tests/tests/round_trip/import-gc.wat index 01c71574..c70ae389 100644 --- a/crates/tests/tests/round_trip/import-gc.wat +++ b/crates/tests/tests/round_trip/import-gc.wat @@ -1,7 +1,7 @@ (module (type (func)) (import "" "a" (func (type 0))) - (import "" "b" (table 1 anyfunc)) + (import "" "b" (table 1 funcref)) (import "" "c" (global i32)) (import "" "d" (memory 1)) ) diff --git a/crates/tests/tests/round_trip/import-table.wat b/crates/tests/tests/round_trip/import-table.wat index ff4e7c7a..85b6bd85 100644 --- a/crates/tests/tests/round_trip/import-table.wat +++ b/crates/tests/tests/round_trip/import-table.wat @@ -1,5 +1,5 @@ (module - (import "" "" (table 1 anyfunc)) + (import "" "" (table 1 funcref)) (export "b" (table 0)) ) diff --git a/crates/tests/tests/round_trip/keep-elem-segments.wat b/crates/tests/tests/round_trip/keep-elem-segments.wat index 5839ea57..63461670 100644 --- a/crates/tests/tests/round_trip/keep-elem-segments.wat +++ b/crates/tests/tests/round_trip/keep-elem-segments.wat @@ -1,7 +1,7 @@ (module (type (func)) - (table anyfunc (elem 1)) + (table funcref (elem 1)) (func i32.const 0 diff --git a/crates/tests/tests/round_trip/table-init.wast b/crates/tests/tests/round_trip/table-init.wast index dbfa1e9f..29f610a5 100644 --- a/crates/tests/tests/round_trip/table-init.wast +++ b/crates/tests/tests/round_trip/table-init.wast @@ -1,6 +1,6 @@ (module (import "x" "y" (global i32)) - (table 1 anyfunc) + (table 1 funcref) (func) (elem (global.get 0) 0) (export "x" (table 0))) diff --git a/crates/tests/tests/valid/const.wat b/crates/tests/tests/valid/const.wat index 5a187f75..f89ca249 100644 --- a/crates/tests/tests/valid/const.wat +++ b/crates/tests/tests/valid/const.wat @@ -2,5 +2,5 @@ (type (;0;) (func (result i32))) (func $inc (type 0) (result i32) i32.const 42) - (table (;0;) 1 1 anyfunc) + (table (;0;) 1 1 funcref) (memory (;0;) 16)) diff --git a/crates/tests/tests/valid/inc.wat b/crates/tests/tests/valid/inc.wat index 4aaacfcd..4ca53f62 100644 --- a/crates/tests/tests/valid/inc.wat +++ b/crates/tests/tests/valid/inc.wat @@ -4,5 +4,5 @@ local.get 0 i32.const 1 i32.add) - (table (;0;) 1 1 anyfunc) + (table (;0;) 1 1 funcref) (memory (;0;) 16)) diff --git a/src/error.rs b/src/error.rs index 5ce597ae..55e65933 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,6 +1,5 @@ //! Error types and utilities. -pub use anyhow::Error; use std::fmt; /// Either `Ok(T)` or `Err(failure::Error)`. diff --git a/src/module/custom.rs b/src/module/custom.rs index 8c4d93cd..89469ee7 100644 --- a/src/module/custom.rs +++ b/src/module/custom.rs @@ -36,9 +36,7 @@ pub trait CustomSection: WalrusAny + Debug + Send + Sync { /// array provided. /// /// The default provided method does nothing. - fn add_gc_roots(&self, roots: &mut Roots) { - drop(roots); - } + fn add_gc_roots(&self, _roots: &mut Roots) {} /// Apply the given code transformations to this custom section. /// diff --git a/src/module/exports.rs b/src/module/exports.rs index 38a1ee03..f51042f9 100644 --- a/src/module/exports.rs +++ b/src/module/exports.rs @@ -1,6 +1,6 @@ //! Exported items in a wasm module. -use anyhow::{bail, Context}; +use anyhow::Context; use crate::emit::{Emit, EmitContext}; use crate::parse::IndicesToIds;