A lightweight WebAssembly runtime that is fast, secure, and standards-compliant
Update to wasm-tools 260 (#14456)
Alex Crichtonc92e8adfe178
diff --git a/Cargo.lock b/Cargo.lockindex e8a81c6e25..3ff3e719d2 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -560,7 +560,7 @@ dependencies = ["test-programs-artifacts","tokio","wasm-compose",- "wasmparser 0.259.0",+ "wasmparser 0.260.0","wasmtime","wasmtime-wasi",]@@ -2158,14 +2158,14 @@ dependencies = [[[package]]name = "json-from-wast"-version = "0.259.0"+version = "0.260.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "7a27a2a28655413fb7a515592b0b2b79631c0a34ea51122603320664d6de395c"+checksum = "78a16aab436cd31d583a6bfaa27fd43264f15df0843f6f7a4673e99928434c88"dependencies = ["anyhow","serde","serde_derive",- "wast 259.0.0",+ "wast 260.0.0",][[package]]@@ -3755,7 +3755,7 @@ dependencies = ["wasmtime","wasmtime-test-util","wat",- "wit-component 0.259.0",+ "wit-component 0.260.0",][[package]]@@ -4222,7 +4222,7 @@ name = "verify-component-adapter"version = "50.0.0-dev"dependencies = ["anyhow",- "wasmparser 0.259.0",+ "wasmparser 0.260.0","wat",]@@ -4299,7 +4299,7 @@ dependencies = ["byte-array-literals","object 0.40.0","wasip1",- "wasm-encoder 0.259.0",+ "wasm-encoder 0.260.0","wit-bindgen-rust-macro 0.62.0",]@@ -4329,17 +4329,17 @@ dependencies = [[[package]]name = "wasm-compose"-version = "0.259.0"+version = "0.260.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "8aea3892e99cd163b7ac32984bbd434328928d63a9305ef1c55b1de3a42ae530"+checksum = "05106c4f0b304aee92d905c9b915d1042abb7245c1f53dbcd610f34b3c8d0ad2"dependencies = ["anyhow","indexmap 2.14.0","log","petgraph","smallvec 1.15.1",- "wasm-encoder 0.259.0",- "wasmparser 0.259.0",+ "wasm-encoder 0.260.0",+ "wasmparser 0.260.0","wat",]@@ -4363,6 +4363,16 @@ dependencies = ["wasmparser 0.259.0",]+[[package]]+name = "wasm-encoder"+version = "0.260.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e1e9692da9ef627c5ee12b45378f68ac2689ce306f88078f5cf849b7c3444ed8"+dependencies = [+ "leb128fmt",+ "wasmparser 0.260.0",+]+[[package]]name = "wasm-metadata"version = "0.244.0"@@ -4387,32 +4397,44 @@ dependencies = ["wasmparser 0.259.0",]+[[package]]+name = "wasm-metadata"+version = "0.260.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8b777ac62b820a7e0fd6b1d6beb2712bfa15a89f611e6cd792ec60468f66d6fa"+dependencies = [+ "anyhow",+ "indexmap 2.14.0",+ "wasm-encoder 0.260.0",+ "wasmparser 0.260.0",+]+[[package]]name = "wasm-mutate"-version = "0.259.0"+version = "0.260.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "71051ca415c103603a5b92b58a87f559da36dde72a43427c48838cbd9ab24977"+checksum = "4c6582a2a8fd4449b4923fdcfbf821cdd24f937ce73fc6e54d8e5efbb7ce7c07"dependencies = ["egg","log","rand 0.10.1","thiserror 2.0.17",- "wasm-encoder 0.259.0",- "wasmparser 0.259.0",+ "wasm-encoder 0.260.0",+ "wasmparser 0.260.0",][[package]]name = "wasm-smith"-version = "0.259.0"+version = "0.260.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "8790c064265f6d6cdaa30a2e53ccb779a3d157a16286640a4b0d64d6e7df3aa4"+checksum = "576a083245b0179210f505204c5cc65f81fe45d7c79b28d78378d3e57a96469b"dependencies = ["anyhow","arbitrary","flagset","serde","serde_derive",- "wasm-encoder 0.259.0",+ "wasm-encoder 0.260.0","wat",]@@ -4426,14 +4448,14 @@ dependencies = [[[package]]name = "wasm-wave"-version = "0.259.0"+version = "0.260.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "583b7203d031ad7b426e12147042e49bc6abee8dfce21f76ceefcaa4121aae09"+checksum = "a95c97b7d741570e7b58758b1debddff3d8c714f4266f78a4f5906544ef60ead"dependencies = ["anyhow","logos","thiserror 2.0.17",- "wit-parser 0.259.0",+ "wit-parser 0.260.0",][[package]]@@ -4503,6 +4525,18 @@ name = "wasmparser"version = "0.259.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "0f7c12eac7bb587801590f6a67ff0bc84d0748513864b71108e4b311cc3df694"+dependencies = [+ "bitflags 2.11.1",+ "hashbrown 0.17.0",+ "indexmap 2.14.0",+ "semver",+]++[[package]]+name = "wasmparser"+version = "0.260.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4c94519d78304dc4a4bb5925eda6ff153bf06167467cff9233dc9593bae28fdd"dependencies = ["bitflags 2.11.1","hashbrown 0.17.0",@@ -4513,13 +4547,13 @@ dependencies = [[[package]]name = "wasmprinter"-version = "0.259.0"+version = "0.260.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "0510ce2ff0ad7c5510ad3dfcb2cedba4cf5d9f7e08d1d06e4d8cf8e5638aef95"+checksum = "7933315fe78398c862b85af65002a2e331031fbddcfe74f1f52b863fe51208e0"dependencies = ["anyhow","termcolor",- "wasmparser 0.259.0",+ "wasmparser 0.260.0",][[package]]@@ -4561,9 +4595,9 @@ dependencies = ["tempfile","tokio","wasm-compose",- "wasm-encoder 0.259.0",+ "wasm-encoder 0.260.0","wasm-wave",- "wasmparser 0.259.0",+ "wasmparser 0.260.0","wasmtime-environ","wasmtime-internal-cache","wasmtime-internal-component-macro",@@ -4580,7 +4614,7 @@ dependencies = ["wasmtime-test-util","wat","windows-sys 0.61.2",- "wit-parser 0.259.0",+ "wit-parser 0.260.0",][[package]]@@ -4672,8 +4706,8 @@ dependencies = ["toml","tracing","walkdir",- "wasm-encoder 0.259.0",- "wasmparser 0.259.0",+ "wasm-encoder 0.260.0",+ "wasmparser 0.260.0","wasmprinter","wasmtime","wasmtime-cli-flags",@@ -4695,10 +4729,10 @@ dependencies = ["wasmtime-wasi-tls","wasmtime-wast","wasmtime-wizer",- "wast 259.0.0",+ "wast 260.0.0","wat","windows-sys 0.61.2",- "wit-component 0.259.0",+ "wit-component 0.260.0",][[package]]@@ -4742,8 +4776,8 @@ dependencies = ["sha2","smallvec 1.15.1","target-lexicon 0.13.5",- "wasm-encoder 0.259.0",- "wasmparser 0.259.0",+ "wasm-encoder 0.260.0",+ "wasmparser 0.260.0","wasmprinter","wasmtime-internal-component-util","wasmtime-internal-core",@@ -4757,7 +4791,7 @@ dependencies = ["arbitrary","env_logger 0.11.5","libfuzzer-sys",- "wasmparser 0.259.0",+ "wasmparser 0.260.0","wasmprinter","wasmtime-environ","wasmtime-test-util",@@ -4789,7 +4823,7 @@ dependencies = ["rand 0.10.1","smallvec 1.15.1","target-lexicon 0.13.5",- "wasmparser 0.259.0",+ "wasmparser 0.260.0","wasmtime","wasmtime-fuzzing","wasmtime-internal-core",@@ -4817,12 +4851,12 @@ dependencies = ["tempfile","tokio","v8",- "wasm-encoder 0.259.0",+ "wasm-encoder 0.260.0","wasm-mutate","wasm-smith","wasm-spec-interpreter","wasmi",- "wasmparser 0.259.0",+ "wasmparser 0.260.0","wasmprinter","wasmtime","wasmtime-cli-flags",@@ -4879,7 +4913,7 @@ dependencies = ["wasmtime","wasmtime-internal-component-util","wasmtime-internal-wit-bindgen",- "wit-parser 0.259.0",+ "wit-parser 0.260.0",][[package]]@@ -4913,7 +4947,7 @@ dependencies = ["smallvec 1.15.1","target-lexicon 0.13.5","thiserror 2.0.17",- "wasmparser 0.259.0",+ "wasmparser 0.260.0","wasmtime-environ","wasmtime-internal-core","wasmtime-internal-unwinder",@@ -5029,7 +5063,7 @@ dependencies = ["log","object 0.40.0","target-lexicon 0.13.5",- "wasmparser 0.259.0",+ "wasmparser 0.260.0","wasmtime-environ","wasmtime-internal-cranelift","winch-codegen",@@ -5043,8 +5077,8 @@ dependencies = ["bitflags 2.11.1","heck","indexmap 2.14.0",- "wit-component 0.259.0",- "wit-parser 0.259.0",+ "wit-component 0.260.0",+ "wit-parser 0.260.0",][[package]]@@ -5088,7 +5122,7 @@ dependencies = ["serde_derive","target-lexicon 0.13.5","toml",- "wasmparser 0.259.0",+ "wasmparser 0.260.0","wasmprinter","wasmtime","wasmtime-environ",@@ -5235,9 +5269,9 @@ dependencies = ["object 0.40.0","serde_json","tokio",- "wasmparser 0.259.0",+ "wasmparser 0.260.0","wasmtime",- "wast 259.0.0",+ "wast 260.0.0",][[package]]@@ -5251,8 +5285,8 @@ dependencies = ["rayon","test-programs-artifacts","tokio",- "wasm-encoder 0.259.0",- "wasmparser 0.259.0",+ "wasm-encoder 0.260.0",+ "wasmparser 0.260.0","wasmprinter","wasmtime","wasmtime-wasi",@@ -5270,25 +5304,25 @@ dependencies = [[[package]]name = "wast"-version = "259.0.0"+version = "260.0.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "c69beba8d9da07af9a0971b559149a2ac4729895b55144de4fddbf5a02660648"+checksum = "17573754cde137d26852892330414efb6d1d33480adcd10e8825d092b2132229"dependencies = ["bumpalo","gimli 0.34.0","leb128fmt","memchr","unicode-width 0.2.0",- "wasm-encoder 0.259.0",+ "wasm-encoder 0.260.0",][[package]]name = "wat"-version = "1.259.0"+version = "1.260.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "c6eec44b0c80391b20fb7ad9ea440c72c5d382385bdf74444bb18321c425017e"+checksum = "5f56de9341c410d04121da51dd16c11d095cb6a914bd2b2850cd3c60558c0c15"dependencies = [- "wast 259.0.0",+ "wast 260.0.0",][[package]]@@ -5415,7 +5449,7 @@ dependencies = ["smallvec 1.15.1","target-lexicon 0.13.5","thiserror 2.0.17",- "wasmparser 0.259.0",+ "wasmparser 0.260.0","wasmtime-environ","wasmtime-internal-core","wasmtime-internal-cranelift",@@ -5728,6 +5762,25 @@ dependencies = ["wit-parser 0.259.0",]+[[package]]+name = "wit-component"+version = "0.260.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "389106e4fbac7c5bbece1496c442d2aceb1926c18884a3ad76f7559c160b8883"+dependencies = [+ "anyhow",+ "bitflags 2.11.1",+ "indexmap 2.14.0",+ "log",+ "serde",+ "serde_derive",+ "serde_json",+ "wasm-encoder 0.260.0",+ "wasm-metadata 0.260.0",+ "wasmparser 0.260.0",+ "wit-parser 0.260.0",+]+[[package]]name = "wit-parser"version = "0.244.0"@@ -5765,6 +5818,25 @@ dependencies = ["wasmparser 0.259.0",]+[[package]]+name = "wit-parser"+version = "0.260.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3152a979bbe19638bb0655cc919d5a68ba1b7b2258f8f43f7c74430004ae7f5e"+dependencies = [+ "anyhow",+ "hashbrown 0.17.0",+ "id-arena",+ "indexmap 2.14.0",+ "log",+ "semver",+ "serde",+ "serde_derive",+ "serde_json",+ "unicode-ident",+ "wasmparser 0.260.0",+]+[[package]]name = "witx"version = "0.9.1"diff --git a/Cargo.toml b/Cargo.tomlindex 2a82d3745e..76dd6ecf0d 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -369,18 +369,18 @@ wit-bindgen = { version = "0.62.0", default-features = false }wit-bindgen-rust-macro = { version = "0.62.0", default-features = false }# wasm-tools family:-wasmparser = { version = "0.259.0", default-features = false, features = ['simd'] }-wat = "1.259.0"-wast = "259.0.0"-wasmprinter = "0.259.0"-wasm-encoder = "0.259.0"-wasm-smith = "0.259.0"-wasm-mutate = "0.259.0"-wit-parser = "0.259.0"-wit-component = "0.259.0"-wasm-wave = "0.259.0"-wasm-compose = { version = "0.259.0", default-features = false }-json-from-wast = "0.259.0"+wasmparser = { version = "0.260.0", default-features = false, features = ['simd'] }+wat = "1.260.0"+wast = "260.0.0"+wasmprinter = "0.260.0"+wasm-encoder = "0.260.0"+wasm-smith = "0.260.0"+wasm-mutate = "0.260.0"+wit-parser = "0.260.0"+wit-component = "0.260.0"+wasm-wave = "0.260.0"+wasm-compose = { version = "0.260.0", default-features = false }+json-from-wast = "0.260.0"wstd = "0.6.5"wasip2 = "1.0"diff --git a/crates/component-macro/tests/codegen/records.wit b/crates/component-macro/tests/codegen/records.witindex ea85dabac9..a8134a87fd 100644--- a/crates/component-macro/tests/codegen/records.wit+++ b/crates/component-macro/tests/codegen/records.wit@@ -4,7 +4,9 @@ interface records {tuple-arg: func(x: tuple<char, u32>);tuple-result: func() -> tuple<char, u32>;- record empty {}+ record empty {+ a: u32,+ }empty-arg: func(x: empty);empty-result: func() -> empty;diff --git a/crates/component-macro/tests/codegen/simple-wasi.wit b/crates/component-macro/tests/codegen/simple-wasi.witindex 2ab07d32d8..9903b5c317 100644--- a/crates/component-macro/tests/codegen/simple-wasi.wit+++ b/crates/component-macro/tests/codegen/simple-wasi.wit@@ -2,6 +2,7 @@ package foo:foo;interface wasi-filesystem {record descriptor-stat {+ a: u32,}enum errno { e }@@ -14,6 +15,7 @@ interface wasi-filesystem {interface wall-clock {record wall-clock {+ a: u32,}}diff --git a/crates/component-macro/tests/codegen/use-paths.wit b/crates/component-macro/tests/codegen/use-paths.witindex 3a16b375d3..10fe67715b 100644--- a/crates/component-macro/tests/codegen/use-paths.wit+++ b/crates/component-macro/tests/codegen/use-paths.wit@@ -1,7 +1,9 @@package foo:foo;interface a {- record foo {}+ record foo {+ a: u32,+ }a: func() -> foo;}diff --git a/crates/component-macro/tests/codegen/variants.wit b/crates/component-macro/tests/codegen/variants.witindex ad5c6911da..3545b1507f 100644--- a/crates/component-macro/tests/codegen/variants.wit+++ b/crates/component-macro/tests/codegen/variants.wit@@ -8,7 +8,9 @@ interface variants {e1-arg: func(x: e1);e1-result: func() -> e1;- record empty {}+ record empty {+ a: u32,+ }variant v1 {a,@@ -27,7 +29,7 @@ interface variants {option-arg: func(a: option<bool>,- b: option<tuple<>>,+ b: option<tuple<u32>>,c: option<u32>,d: option<e1>,e: option<f32>,@@ -35,7 +37,7 @@ interface variants {);option-result: func() -> tuple<option<bool>,- option<tuple<>>,+ option<tuple<u32>>,option<u32>,option<e1>,option<f32>,@@ -92,7 +94,7 @@ interface variants {a: result,b: result<_, e1>,c: result<e1>,- d: result<tuple<>, tuple<>>,+ d: result<tuple<u32>, tuple<u32>>,e: result<u32, v1>,f: result<string, list<u8>>,);@@ -100,7 +102,7 @@ interface variants {result,result<_, e1>,result<e1>,- result<tuple<>, tuple<>>,+ result<tuple<u32>, tuple<u32>>,result<u32, v1>,result<string, list<u8>>,>;diff --git a/crates/component-macro/tests/codegen/worlds-with-types.wit b/crates/component-macro/tests/codegen/worlds-with-types.witindex 149e392dfc..7fcaab200c 100644--- a/crates/component-macro/tests/codegen/worlds-with-types.wit+++ b/crates/component-macro/tests/codegen/worlds-with-types.wit@@ -10,6 +10,7 @@ world foo {type t = u32;record r {+ a: u32,}export f: func() -> tuple<t, u, r>;diff --git a/crates/component-macro/tests/expanded/records.rs b/crates/component-macro/tests/expanded/records.rsindex 39f276e378..db8bfe8d48 100644--- a/crates/component-macro/tests/expanded/records.rs+++ b/crates/component-macro/tests/expanded/records.rs@@ -196,15 +196,18 @@ pub mod foo {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct Empty {}+ pub struct Empty {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for Empty {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("Empty").finish()+ f.debug_struct("Empty").field("a", &self.a).finish()}}const _: () = {- assert!(0 == < Empty as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Empty as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Empty as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Empty as wasmtime::component::ComponentType >::ALIGN32);};/// A record containing two scalar fields/// that both have the same type@@ -313,7 +316,7 @@ pub mod foo {}const _: () = {assert!(- 32 == < Aggregates as wasmtime::component::ComponentType >::SIZE32+ 36 == < Aggregates as wasmtime::component::ComponentType >::SIZE32);assert!(4 == < Aggregates as wasmtime::component::ComponentType >::ALIGN32@@ -585,21 +588,24 @@ pub mod exports {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct Empty {}+ pub struct Empty {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for Empty {fn fmt(&self,f: &mut core::fmt::Formatter<'_>,) -> core::fmt::Result {- f.debug_struct("Empty").finish()+ f.debug_struct("Empty").field("a", &self.a).finish()}}const _: () = {assert!(- 0 == < Empty as wasmtime::component::ComponentType >::SIZE32+ 4 == < Empty as wasmtime::component::ComponentType >::SIZE32);assert!(- 1 == < Empty as wasmtime::component::ComponentType >::ALIGN32+ 4 == < Empty as wasmtime::component::ComponentType >::ALIGN32);};/// A record containing two scalar fields@@ -724,7 +730,7 @@ pub mod exports {}const _: () = {assert!(- 32 == < Aggregates as wasmtime::component::ComponentType+ 36 == < Aggregates as wasmtime::component::ComponentType>::SIZE32);assert!(diff --git a/crates/component-macro/tests/expanded/records_async.rs b/crates/component-macro/tests/expanded/records_async.rsindex f0994804cf..56b074faa4 100644--- a/crates/component-macro/tests/expanded/records_async.rs+++ b/crates/component-macro/tests/expanded/records_async.rs@@ -196,15 +196,18 @@ pub mod foo {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct Empty {}+ pub struct Empty {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for Empty {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("Empty").finish()+ f.debug_struct("Empty").field("a", &self.a).finish()}}const _: () = {- assert!(0 == < Empty as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Empty as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Empty as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Empty as wasmtime::component::ComponentType >::ALIGN32);};/// A record containing two scalar fields/// that both have the same type@@ -313,7 +316,7 @@ pub mod foo {}const _: () = {assert!(- 32 == < Aggregates as wasmtime::component::ComponentType >::SIZE32+ 36 == < Aggregates as wasmtime::component::ComponentType >::SIZE32);assert!(4 == < Aggregates as wasmtime::component::ComponentType >::ALIGN32@@ -663,21 +666,24 @@ pub mod exports {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct Empty {}+ pub struct Empty {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for Empty {fn fmt(&self,f: &mut core::fmt::Formatter<'_>,) -> core::fmt::Result {- f.debug_struct("Empty").finish()+ f.debug_struct("Empty").field("a", &self.a).finish()}}const _: () = {assert!(- 0 == < Empty as wasmtime::component::ComponentType >::SIZE32+ 4 == < Empty as wasmtime::component::ComponentType >::SIZE32);assert!(- 1 == < Empty as wasmtime::component::ComponentType >::ALIGN32+ 4 == < Empty as wasmtime::component::ComponentType >::ALIGN32);};/// A record containing two scalar fields@@ -802,7 +808,7 @@ pub mod exports {}const _: () = {assert!(- 32 == < Aggregates as wasmtime::component::ComponentType+ 36 == < Aggregates as wasmtime::component::ComponentType>::SIZE32);assert!(diff --git a/crates/component-macro/tests/expanded/records_concurrent.rs b/crates/component-macro/tests/expanded/records_concurrent.rsindex 3197ead3b6..b86d12829d 100644--- a/crates/component-macro/tests/expanded/records_concurrent.rs+++ b/crates/component-macro/tests/expanded/records_concurrent.rs@@ -196,15 +196,18 @@ pub mod foo {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct Empty {}+ pub struct Empty {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for Empty {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("Empty").finish()+ f.debug_struct("Empty").field("a", &self.a).finish()}}const _: () = {- assert!(0 == < Empty as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Empty as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Empty as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Empty as wasmtime::component::ComponentType >::ALIGN32);};/// A record containing two scalar fields/// that both have the same type@@ -313,7 +316,7 @@ pub mod foo {}const _: () = {assert!(- 32 == < Aggregates as wasmtime::component::ComponentType >::SIZE32+ 36 == < Aggregates as wasmtime::component::ComponentType >::SIZE32);assert!(4 == < Aggregates as wasmtime::component::ComponentType >::ALIGN32@@ -667,21 +670,24 @@ pub mod exports {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct Empty {}+ pub struct Empty {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for Empty {fn fmt(&self,f: &mut core::fmt::Formatter<'_>,) -> core::fmt::Result {- f.debug_struct("Empty").finish()+ f.debug_struct("Empty").field("a", &self.a).finish()}}const _: () = {assert!(- 0 == < Empty as wasmtime::component::ComponentType >::SIZE32+ 4 == < Empty as wasmtime::component::ComponentType >::SIZE32);assert!(- 1 == < Empty as wasmtime::component::ComponentType >::ALIGN32+ 4 == < Empty as wasmtime::component::ComponentType >::ALIGN32);};/// A record containing two scalar fields@@ -806,7 +812,7 @@ pub mod exports {}const _: () = {assert!(- 32 == < Aggregates as wasmtime::component::ComponentType+ 36 == < Aggregates as wasmtime::component::ComponentType>::SIZE32);assert!(diff --git a/crates/component-macro/tests/expanded/records_tracing_async.rs b/crates/component-macro/tests/expanded/records_tracing_async.rsindex 78dff8e4ba..7309ef907a 100644--- a/crates/component-macro/tests/expanded/records_tracing_async.rs+++ b/crates/component-macro/tests/expanded/records_tracing_async.rs@@ -196,15 +196,18 @@ pub mod foo {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct Empty {}+ pub struct Empty {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for Empty {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("Empty").finish()+ f.debug_struct("Empty").field("a", &self.a).finish()}}const _: () = {- assert!(0 == < Empty as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Empty as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Empty as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Empty as wasmtime::component::ComponentType >::ALIGN32);};/// A record containing two scalar fields/// that both have the same type@@ -313,7 +316,7 @@ pub mod foo {}const _: () = {assert!(- 32 == < Aggregates as wasmtime::component::ComponentType >::SIZE32+ 36 == < Aggregates as wasmtime::component::ComponentType >::SIZE32);assert!(4 == < Aggregates as wasmtime::component::ComponentType >::ALIGN32@@ -824,21 +827,24 @@ pub mod exports {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct Empty {}+ pub struct Empty {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for Empty {fn fmt(&self,f: &mut core::fmt::Formatter<'_>,) -> core::fmt::Result {- f.debug_struct("Empty").finish()+ f.debug_struct("Empty").field("a", &self.a).finish()}}const _: () = {assert!(- 0 == < Empty as wasmtime::component::ComponentType >::SIZE32+ 4 == < Empty as wasmtime::component::ComponentType >::SIZE32);assert!(- 1 == < Empty as wasmtime::component::ComponentType >::ALIGN32+ 4 == < Empty as wasmtime::component::ComponentType >::ALIGN32);};/// A record containing two scalar fields@@ -963,7 +969,7 @@ pub mod exports {}const _: () = {assert!(- 32 == < Aggregates as wasmtime::component::ComponentType+ 36 == < Aggregates as wasmtime::component::ComponentType>::SIZE32);assert!(diff --git a/crates/component-macro/tests/expanded/simple-wasi.rs b/crates/component-macro/tests/expanded/simple-wasi.rsindex d7b8306f04..ebc0d0cd71 100644--- a/crates/component-macro/tests/expanded/simple-wasi.rs+++ b/crates/component-macro/tests/expanded/simple-wasi.rs@@ -189,18 +189,21 @@ pub mod foo {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct DescriptorStat {}+ pub struct DescriptorStat {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for DescriptorStat {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("DescriptorStat").finish()+ f.debug_struct("DescriptorStat").field("a", &self.a).finish()}}const _: () = {assert!(- 0 == < DescriptorStat as wasmtime::component::ComponentType >::SIZE32+ 4 == < DescriptorStat as wasmtime::component::ComponentType >::SIZE32);assert!(- 1 == < DescriptorStat as wasmtime::component::ComponentType+ 4 == < DescriptorStat as wasmtime::component::ComponentType>::ALIGN32);};@@ -311,18 +314,21 @@ pub mod foo {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct WallClock {}+ pub struct WallClock {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for WallClock {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("WallClock").finish()+ f.debug_struct("WallClock").field("a", &self.a).finish()}}const _: () = {assert!(- 0 == < WallClock as wasmtime::component::ComponentType >::SIZE32+ 4 == < WallClock as wasmtime::component::ComponentType >::SIZE32);assert!(- 1 == < WallClock as wasmtime::component::ComponentType >::ALIGN32+ 4 == < WallClock as wasmtime::component::ComponentType >::ALIGN32);};pub trait HostWithStore<T>: wasmtime::component::HasData {}diff --git a/crates/component-macro/tests/expanded/simple-wasi_async.rs b/crates/component-macro/tests/expanded/simple-wasi_async.rsindex 0d58c1876b..9b6c19c9fd 100644--- a/crates/component-macro/tests/expanded/simple-wasi_async.rs+++ b/crates/component-macro/tests/expanded/simple-wasi_async.rs@@ -189,18 +189,21 @@ pub mod foo {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct DescriptorStat {}+ pub struct DescriptorStat {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for DescriptorStat {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("DescriptorStat").finish()+ f.debug_struct("DescriptorStat").field("a", &self.a).finish()}}const _: () = {assert!(- 0 == < DescriptorStat as wasmtime::component::ComponentType >::SIZE32+ 4 == < DescriptorStat as wasmtime::component::ComponentType >::SIZE32);assert!(- 1 == < DescriptorStat as wasmtime::component::ComponentType+ 4 == < DescriptorStat as wasmtime::component::ComponentType>::ALIGN32);};@@ -327,18 +330,21 @@ pub mod foo {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct WallClock {}+ pub struct WallClock {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for WallClock {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("WallClock").finish()+ f.debug_struct("WallClock").field("a", &self.a).finish()}}const _: () = {assert!(- 0 == < WallClock as wasmtime::component::ComponentType >::SIZE32+ 4 == < WallClock as wasmtime::component::ComponentType >::SIZE32);assert!(- 1 == < WallClock as wasmtime::component::ComponentType >::ALIGN32+ 4 == < WallClock as wasmtime::component::ComponentType >::ALIGN32);};pub trait HostWithStore<T>: wasmtime::component::HasData {}diff --git a/crates/component-macro/tests/expanded/simple-wasi_concurrent.rs b/crates/component-macro/tests/expanded/simple-wasi_concurrent.rsindex 09b38d9d53..5b076cf023 100644--- a/crates/component-macro/tests/expanded/simple-wasi_concurrent.rs+++ b/crates/component-macro/tests/expanded/simple-wasi_concurrent.rs@@ -189,18 +189,21 @@ pub mod foo {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct DescriptorStat {}+ pub struct DescriptorStat {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for DescriptorStat {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("DescriptorStat").finish()+ f.debug_struct("DescriptorStat").field("a", &self.a).finish()}}const _: () = {assert!(- 0 == < DescriptorStat as wasmtime::component::ComponentType >::SIZE32+ 4 == < DescriptorStat as wasmtime::component::ComponentType >::SIZE32);assert!(- 1 == < DescriptorStat as wasmtime::component::ComponentType+ 4 == < DescriptorStat as wasmtime::component::ComponentType>::ALIGN32);};@@ -323,18 +326,21 @@ pub mod foo {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct WallClock {}+ pub struct WallClock {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for WallClock {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("WallClock").finish()+ f.debug_struct("WallClock").field("a", &self.a).finish()}}const _: () = {assert!(- 0 == < WallClock as wasmtime::component::ComponentType >::SIZE32+ 4 == < WallClock as wasmtime::component::ComponentType >::SIZE32);assert!(- 1 == < WallClock as wasmtime::component::ComponentType >::ALIGN32+ 4 == < WallClock as wasmtime::component::ComponentType >::ALIGN32);};pub trait HostWithStore<T>: wasmtime::component::HasData {}diff --git a/crates/component-macro/tests/expanded/simple-wasi_tracing_async.rs b/crates/component-macro/tests/expanded/simple-wasi_tracing_async.rsindex 4a7f1a7d8c..f78e8a013f 100644--- a/crates/component-macro/tests/expanded/simple-wasi_tracing_async.rs+++ b/crates/component-macro/tests/expanded/simple-wasi_tracing_async.rs@@ -189,18 +189,21 @@ pub mod foo {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct DescriptorStat {}+ pub struct DescriptorStat {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for DescriptorStat {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("DescriptorStat").finish()+ f.debug_struct("DescriptorStat").field("a", &self.a).finish()}}const _: () = {assert!(- 0 == < DescriptorStat as wasmtime::component::ComponentType >::SIZE32+ 4 == < DescriptorStat as wasmtime::component::ComponentType >::SIZE32);assert!(- 1 == < DescriptorStat as wasmtime::component::ComponentType+ 4 == < DescriptorStat as wasmtime::component::ComponentType>::ALIGN32);};@@ -353,18 +356,21 @@ pub mod foo {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct WallClock {}+ pub struct WallClock {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for WallClock {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("WallClock").finish()+ f.debug_struct("WallClock").field("a", &self.a).finish()}}const _: () = {assert!(- 0 == < WallClock as wasmtime::component::ComponentType >::SIZE32+ 4 == < WallClock as wasmtime::component::ComponentType >::SIZE32);assert!(- 1 == < WallClock as wasmtime::component::ComponentType >::ALIGN32+ 4 == < WallClock as wasmtime::component::ComponentType >::ALIGN32);};pub trait HostWithStore<T>: wasmtime::component::HasData {}diff --git a/crates/component-macro/tests/expanded/use-paths.rs b/crates/component-macro/tests/expanded/use-paths.rsindex bdf0d70450..b4d104fa08 100644--- a/crates/component-macro/tests/expanded/use-paths.rs+++ b/crates/component-macro/tests/expanded/use-paths.rs@@ -191,15 +191,18 @@ pub mod foo {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct Foo {}+ pub struct Foo {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for Foo {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("Foo").finish()+ f.debug_struct("Foo").field("a", &self.a).finish()}}const _: () = {- assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Foo as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::ALIGN32);};pub trait HostWithStore<T>: wasmtime::component::HasData {}impl<H: ?Sized, T> HostWithStore<T> for H@@ -252,8 +255,8 @@ pub mod foo {use wasmtime::component::__internal::Box;pub type Foo = super::super::super::foo::foo::a::Foo;const _: () = {- assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Foo as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::ALIGN32);};pub trait HostWithStore<T>: wasmtime::component::HasData {}impl<H: ?Sized, T> HostWithStore<T> for H@@ -306,8 +309,8 @@ pub mod foo {use wasmtime::component::__internal::Box;pub type Foo = super::super::super::foo::foo::b::Foo;const _: () = {- assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Foo as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::ALIGN32);};pub trait HostWithStore<T>: wasmtime::component::HasData {}impl<H: ?Sized, T> HostWithStore<T> for H@@ -362,8 +365,8 @@ pub mod d {use wasmtime::component::__internal::Box;pub type Foo = super::foo::foo::c::Foo;const _: () = {- assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Foo as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::ALIGN32);};pub trait HostWithStore<T>: wasmtime::component::HasData {}impl<H: ?Sized, T> HostWithStore<T> for Hdiff --git a/crates/component-macro/tests/expanded/use-paths_async.rs b/crates/component-macro/tests/expanded/use-paths_async.rsindex 4089b3ea7c..e166e27981 100644--- a/crates/component-macro/tests/expanded/use-paths_async.rs+++ b/crates/component-macro/tests/expanded/use-paths_async.rs@@ -192,15 +192,18 @@ pub mod foo {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct Foo {}+ pub struct Foo {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for Foo {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("Foo").finish()+ f.debug_struct("Foo").field("a", &self.a).finish()}}const _: () = {- assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Foo as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::ALIGN32);};pub trait HostWithStore<T>: wasmtime::component::HasData + Send {}impl<H: ?Sized, T> HostWithStore<T> for H@@ -255,8 +258,8 @@ pub mod foo {use wasmtime::component::__internal::Box;pub type Foo = super::super::super::foo::foo::a::Foo;const _: () = {- assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Foo as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::ALIGN32);};pub trait HostWithStore<T>: wasmtime::component::HasData + Send {}impl<H: ?Sized, T> HostWithStore<T> for H@@ -311,8 +314,8 @@ pub mod foo {use wasmtime::component::__internal::Box;pub type Foo = super::super::super::foo::foo::b::Foo;const _: () = {- assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Foo as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::ALIGN32);};pub trait HostWithStore<T>: wasmtime::component::HasData + Send {}impl<H: ?Sized, T> HostWithStore<T> for H@@ -369,8 +372,8 @@ pub mod d {use wasmtime::component::__internal::Box;pub type Foo = super::foo::foo::c::Foo;const _: () = {- assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Foo as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::ALIGN32);};pub trait HostWithStore<T>: wasmtime::component::HasData + Send {}impl<H: ?Sized, T> HostWithStore<T> for Hdiff --git a/crates/component-macro/tests/expanded/use-paths_concurrent.rs b/crates/component-macro/tests/expanded/use-paths_concurrent.rsindex 4e370f224f..2609456075 100644--- a/crates/component-macro/tests/expanded/use-paths_concurrent.rs+++ b/crates/component-macro/tests/expanded/use-paths_concurrent.rs@@ -192,15 +192,18 @@ pub mod foo {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct Foo {}+ pub struct Foo {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for Foo {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("Foo").finish()+ f.debug_struct("Foo").field("a", &self.a).finish()}}const _: () = {- assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Foo as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::ALIGN32);};pub trait HostWithStore<T>: wasmtime::component::HasData + Send {fn a(@@ -255,8 +258,8 @@ pub mod foo {use wasmtime::component::__internal::Box;pub type Foo = super::super::super::foo::foo::a::Foo;const _: () = {- assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Foo as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::ALIGN32);};pub trait HostWithStore<T>: wasmtime::component::HasData + Send {fn a(@@ -311,8 +314,8 @@ pub mod foo {use wasmtime::component::__internal::Box;pub type Foo = super::super::super::foo::foo::b::Foo;const _: () = {- assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Foo as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::ALIGN32);};pub trait HostWithStore<T>: wasmtime::component::HasData + Send {fn a(@@ -369,8 +372,8 @@ pub mod d {use wasmtime::component::__internal::Box;pub type Foo = super::foo::foo::c::Foo;const _: () = {- assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Foo as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::ALIGN32);};pub trait HostWithStore<T>: wasmtime::component::HasData + Send {fn b(diff --git a/crates/component-macro/tests/expanded/use-paths_tracing_async.rs b/crates/component-macro/tests/expanded/use-paths_tracing_async.rsindex 4835f2dacf..9ec9a39c27 100644--- a/crates/component-macro/tests/expanded/use-paths_tracing_async.rs+++ b/crates/component-macro/tests/expanded/use-paths_tracing_async.rs@@ -192,15 +192,18 @@ pub mod foo {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct Foo {}+ pub struct Foo {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for Foo {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("Foo").finish()+ f.debug_struct("Foo").field("a", &self.a).finish()}}const _: () = {- assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Foo as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::ALIGN32);};pub trait HostWithStore<T>: wasmtime::component::HasData + Send {}impl<H: ?Sized, T> HostWithStore<T> for H@@ -268,8 +271,8 @@ pub mod foo {use wasmtime::component::__internal::Box;pub type Foo = super::super::super::foo::foo::a::Foo;const _: () = {- assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Foo as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::ALIGN32);};pub trait HostWithStore<T>: wasmtime::component::HasData + Send {}impl<H: ?Sized, T> HostWithStore<T> for H@@ -337,8 +340,8 @@ pub mod foo {use wasmtime::component::__internal::Box;pub type Foo = super::super::super::foo::foo::b::Foo;const _: () = {- assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Foo as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::ALIGN32);};pub trait HostWithStore<T>: wasmtime::component::HasData + Send {}impl<H: ?Sized, T> HostWithStore<T> for H@@ -408,8 +411,8 @@ pub mod d {use wasmtime::component::__internal::Box;pub type Foo = super::foo::foo::c::Foo;const _: () = {- assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Foo as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Foo as wasmtime::component::ComponentType >::ALIGN32);};pub trait HostWithStore<T>: wasmtime::component::HasData + Send {}impl<H: ?Sized, T> HostWithStore<T> for Hdiff --git a/crates/component-macro/tests/expanded/variants.rs b/crates/component-macro/tests/expanded/variants.rsindex 2adab3623c..ca7226ddfe 100644--- a/crates/component-macro/tests/expanded/variants.rs+++ b/crates/component-macro/tests/expanded/variants.rs@@ -217,15 +217,18 @@ pub mod foo {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct Empty {}+ pub struct Empty {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for Empty {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("Empty").finish()+ f.debug_struct("Empty").field("a", &self.a).finish()}}const _: () = {- assert!(0 == < Empty as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Empty as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Empty as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Empty as wasmtime::component::ComponentType >::ALIGN32);};#[derive(wasmtime::component::ComponentType)]#[derive(wasmtime::component::Lift)]@@ -478,7 +481,7 @@ pub mod foo {fn option_arg(&mut self,a: Option<bool>,- b: Option<()>,+ b: Option<(u32,)>,c: Option<u32>,d: Option<E1>,e: Option<f32>,@@ -488,7 +491,7 @@ pub mod foo {&mut self,) -> (Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -508,7 +511,7 @@ pub mod foo {a: Result<(), ()>,b: Result<(), E1>,c: Result<E1, ()>,- d: Result<(), ()>,+ d: Result<(u32,), (u32,)>,e: Result<u32, V1>,f: Result<wasmtime::component::__internal::String,@@ -521,7 +524,7 @@ pub mod foo {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -560,7 +563,7 @@ pub mod foo {fn option_arg(&mut self,a: Option<bool>,- b: Option<()>,+ b: Option<(u32,)>,c: Option<u32>,d: Option<E1>,e: Option<f32>,@@ -572,7 +575,7 @@ pub mod foo {&mut self,) -> (Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -596,7 +599,7 @@ pub mod foo {a: Result<(), ()>,b: Result<(), E1>,c: Result<E1, ()>,- d: Result<(), ()>,+ d: Result<(u32,), (u32,)>,e: Result<u32, V1>,f: Result<wasmtime::component::__internal::String,@@ -611,7 +614,7 @@ pub mod foo {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -721,7 +724,7 @@ pub mod foo {arg5,): (Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -782,7 +785,7 @@ pub mod foo {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -939,21 +942,24 @@ pub mod exports {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct Empty {}+ pub struct Empty {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for Empty {fn fmt(&self,f: &mut core::fmt::Formatter<'_>,) -> core::fmt::Result {- f.debug_struct("Empty").finish()+ f.debug_struct("Empty").field("a", &self.a).finish()}}const _: () = {assert!(- 0 == < Empty as wasmtime::component::ComponentType >::SIZE32+ 4 == < Empty as wasmtime::component::ComponentType >::SIZE32);assert!(- 1 == < Empty as wasmtime::component::ComponentType >::ALIGN32+ 4 == < Empty as wasmtime::component::ComponentType >::ALIGN32);};#[derive(wasmtime::component::ComponentType)]@@ -1408,7 +1414,7 @@ pub mod exports {.get_typed_func::<(Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1423,7 +1429,7 @@ pub mod exports {((Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1444,7 +1450,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, &V1>,Result<&str, &[u8]>,),@@ -1459,7 +1465,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -1664,7 +1670,7 @@ pub mod exports {) -> wasmtime::component::TypedFunc<(Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1676,7 +1682,7 @@ pub mod exports {wasmtime::component::TypedFunc::<(Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1690,7 +1696,7 @@ pub mod exports {&self,mut store: S,arg0: Option<bool>,- arg1: Option<()>,+ arg1: Option<(u32,)>,arg2: Option<u32>,arg3: Option<E1>,arg4: Option<f32>,@@ -1711,7 +1717,7 @@ pub mod exports {((Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1725,7 +1731,7 @@ pub mod exports {((Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1741,7 +1747,7 @@ pub mod exports {) -> wasmtime::Result<(Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1792,7 +1798,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, &V1>,Result<&str, &[u8]>,),@@ -1804,7 +1810,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, &V1>,Result<&str, &[u8]>,),@@ -1818,7 +1824,7 @@ pub mod exports {arg0: Result<(), ()>,arg1: Result<(), E1>,arg2: Result<E1, ()>,- arg3: Result<(), ()>,+ arg3: Result<(u32,), (u32,)>,arg4: Result<u32, &V1>,arg5: Result<&str, &[u8]>,) -> wasmtime::Result<()> {@@ -1839,7 +1845,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -1856,7 +1862,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -1875,7 +1881,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,diff --git a/crates/component-macro/tests/expanded/variants_async.rs b/crates/component-macro/tests/expanded/variants_async.rsindex 285f040f53..6dce801777 100644--- a/crates/component-macro/tests/expanded/variants_async.rs+++ b/crates/component-macro/tests/expanded/variants_async.rs@@ -217,15 +217,18 @@ pub mod foo {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct Empty {}+ pub struct Empty {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for Empty {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("Empty").finish()+ f.debug_struct("Empty").field("a", &self.a).finish()}}const _: () = {- assert!(0 == < Empty as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Empty as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Empty as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Empty as wasmtime::component::ComponentType >::ALIGN32);};#[derive(wasmtime::component::ComponentType)]#[derive(wasmtime::component::Lift)]@@ -493,7 +496,7 @@ pub mod foo {fn option_arg(&mut self,a: Option<bool>,- b: Option<()>,+ b: Option<(u32,)>,c: Option<u32>,d: Option<E1>,e: Option<f32>,@@ -504,7 +507,7 @@ pub mod foo {) -> impl ::core::future::Future<Output = (Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -527,7 +530,7 @@ pub mod foo {a: Result<(), ()>,b: Result<(), E1>,c: Result<E1, ()>,- d: Result<(), ()>,+ d: Result<(u32,), (u32,)>,e: Result<u32, V1>,f: Result<wasmtime::component::__internal::String,@@ -541,7 +544,7 @@ pub mod foo {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -619,7 +622,7 @@ pub mod foo {fn option_arg(&mut self,a: Option<bool>,- b: Option<()>,+ b: Option<(u32,)>,c: Option<u32>,d: Option<E1>,e: Option<f32>,@@ -632,7 +635,7 @@ pub mod foo {) -> impl ::core::future::Future<Output = (Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -659,7 +662,7 @@ pub mod foo {a: Result<(), ()>,b: Result<(), E1>,c: Result<E1, ()>,- d: Result<(), ()>,+ d: Result<(u32,), (u32,)>,e: Result<u32, V1>,f: Result<wasmtime::component::__internal::String,@@ -675,7 +678,7 @@ pub mod foo {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -821,7 +824,7 @@ pub mod foo {arg5,): (Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -890,7 +893,7 @@ pub mod foo {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -1070,21 +1073,24 @@ pub mod exports {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct Empty {}+ pub struct Empty {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for Empty {fn fmt(&self,f: &mut core::fmt::Formatter<'_>,) -> core::fmt::Result {- f.debug_struct("Empty").finish()+ f.debug_struct("Empty").field("a", &self.a).finish()}}const _: () = {assert!(- 0 == < Empty as wasmtime::component::ComponentType >::SIZE32+ 4 == < Empty as wasmtime::component::ComponentType >::SIZE32);assert!(- 1 == < Empty as wasmtime::component::ComponentType >::ALIGN32+ 4 == < Empty as wasmtime::component::ComponentType >::ALIGN32);};#[derive(wasmtime::component::ComponentType)]@@ -1539,7 +1545,7 @@ pub mod exports {.get_typed_func::<(Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1554,7 +1560,7 @@ pub mod exports {((Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1575,7 +1581,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, &V1>,Result<&str, &[u8]>,),@@ -1590,7 +1596,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -1825,7 +1831,7 @@ pub mod exports {) -> wasmtime::component::TypedFunc<(Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1837,7 +1843,7 @@ pub mod exports {wasmtime::component::TypedFunc::<(Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1851,7 +1857,7 @@ pub mod exports {&self,mut store: S,arg0: Option<bool>,- arg1: Option<()>,+ arg1: Option<(u32,)>,arg2: Option<u32>,arg3: Option<E1>,arg4: Option<f32>,@@ -1876,7 +1882,7 @@ pub mod exports {((Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1890,7 +1896,7 @@ pub mod exports {((Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1906,7 +1912,7 @@ pub mod exports {) -> wasmtime::Result<(Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1966,7 +1972,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, &V1>,Result<&str, &[u8]>,),@@ -1978,7 +1984,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, &V1>,Result<&str, &[u8]>,),@@ -1992,7 +1998,7 @@ pub mod exports {arg0: Result<(), ()>,arg1: Result<(), E1>,arg2: Result<E1, ()>,- arg3: Result<(), ()>,+ arg3: Result<(u32,), (u32,)>,arg4: Result<u32, &V1>,arg5: Result<&str, &[u8]>,) -> wasmtime::Result<()>@@ -2017,7 +2023,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -2034,7 +2040,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -2053,7 +2059,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,diff --git a/crates/component-macro/tests/expanded/variants_concurrent.rs b/crates/component-macro/tests/expanded/variants_concurrent.rsindex acb52222c7..fab3de16b9 100644--- a/crates/component-macro/tests/expanded/variants_concurrent.rs+++ b/crates/component-macro/tests/expanded/variants_concurrent.rs@@ -217,15 +217,18 @@ pub mod foo {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct Empty {}+ pub struct Empty {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for Empty {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("Empty").finish()+ f.debug_struct("Empty").field("a", &self.a).finish()}}const _: () = {- assert!(0 == < Empty as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Empty as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Empty as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Empty as wasmtime::component::ComponentType >::ALIGN32);};#[derive(wasmtime::component::ComponentType)]#[derive(wasmtime::component::Lift)]@@ -488,7 +491,7 @@ pub mod foo {fn option_arg(host: wasmtime::component::Access<T, Self>,a: Option<bool>,- b: Option<()>,+ b: Option<(u32,)>,c: Option<u32>,d: Option<E1>,e: Option<f32>,@@ -499,7 +502,7 @@ pub mod foo {) -> impl ::core::future::Future<Output = (Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -522,7 +525,7 @@ pub mod foo {a: Result<(), ()>,b: Result<(), E1>,c: Result<E1, ()>,- d: Result<(), ()>,+ d: Result<(u32,), (u32,)>,e: Result<u32, V1>,f: Result<wasmtime::component::__internal::String,@@ -536,7 +539,7 @@ pub mod foo {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -700,7 +703,7 @@ pub mod foo {arg5,): (Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -783,7 +786,7 @@ pub mod foo {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -1030,21 +1033,24 @@ pub mod exports {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct Empty {}+ pub struct Empty {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for Empty {fn fmt(&self,f: &mut core::fmt::Formatter<'_>,) -> core::fmt::Result {- f.debug_struct("Empty").finish()+ f.debug_struct("Empty").field("a", &self.a).finish()}}const _: () = {assert!(- 0 == < Empty as wasmtime::component::ComponentType >::SIZE32+ 4 == < Empty as wasmtime::component::ComponentType >::SIZE32);assert!(- 1 == < Empty as wasmtime::component::ComponentType >::ALIGN32+ 4 == < Empty as wasmtime::component::ComponentType >::ALIGN32);};#[derive(wasmtime::component::ComponentType)]@@ -1499,7 +1505,7 @@ pub mod exports {.get_typed_func::<(Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1514,7 +1520,7 @@ pub mod exports {((Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1535,7 +1541,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, &V1>,Result<&str, &[u8]>,),@@ -1550,7 +1556,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -1779,7 +1785,7 @@ pub mod exports {) -> wasmtime::component::TypedFunc<(Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1791,7 +1797,7 @@ pub mod exports {wasmtime::component::TypedFunc::<(Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1805,7 +1811,7 @@ pub mod exports {&self,accessor: &wasmtime::component::Accessor<_T, _D>,arg0: Option<bool>,- arg1: Option<()>,+ arg1: Option<(u32,)>,arg2: Option<u32>,arg3: Option<E1>,arg4: Option<f32>,@@ -1831,7 +1837,7 @@ pub mod exports {((Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1845,7 +1851,7 @@ pub mod exports {((Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1861,7 +1867,7 @@ pub mod exports {) -> wasmtime::Result<(Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1921,7 +1927,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -1936,7 +1942,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -1953,7 +1959,7 @@ pub mod exports {arg0: Result<(), ()>,arg1: Result<(), E1>,arg2: Result<E1, ()>,- arg3: Result<(), ()>,+ arg3: Result<(u32,), (u32,)>,arg4: Result<u32, V1>,arg5: Result<wasmtime::component::__internal::String,@@ -1982,7 +1988,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -1999,7 +2005,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -2018,7 +2024,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,diff --git a/crates/component-macro/tests/expanded/variants_tracing_async.rs b/crates/component-macro/tests/expanded/variants_tracing_async.rsindex 2358da373c..5b23fda0d2 100644--- a/crates/component-macro/tests/expanded/variants_tracing_async.rs+++ b/crates/component-macro/tests/expanded/variants_tracing_async.rs@@ -217,15 +217,18 @@ pub mod foo {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct Empty {}+ pub struct Empty {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for Empty {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("Empty").finish()+ f.debug_struct("Empty").field("a", &self.a).finish()}}const _: () = {- assert!(0 == < Empty as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < Empty as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < Empty as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < Empty as wasmtime::component::ComponentType >::ALIGN32);};#[derive(wasmtime::component::ComponentType)]#[derive(wasmtime::component::Lift)]@@ -493,7 +496,7 @@ pub mod foo {fn option_arg(&mut self,a: Option<bool>,- b: Option<()>,+ b: Option<(u32,)>,c: Option<u32>,d: Option<E1>,e: Option<f32>,@@ -504,7 +507,7 @@ pub mod foo {) -> impl ::core::future::Future<Output = (Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -527,7 +530,7 @@ pub mod foo {a: Result<(), ()>,b: Result<(), E1>,c: Result<E1, ()>,- d: Result<(), ()>,+ d: Result<(u32,), (u32,)>,e: Result<u32, V1>,f: Result<wasmtime::component::__internal::String,@@ -541,7 +544,7 @@ pub mod foo {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -619,7 +622,7 @@ pub mod foo {fn option_arg(&mut self,a: Option<bool>,- b: Option<()>,+ b: Option<(u32,)>,c: Option<u32>,d: Option<E1>,e: Option<f32>,@@ -632,7 +635,7 @@ pub mod foo {) -> impl ::core::future::Future<Output = (Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -659,7 +662,7 @@ pub mod foo {a: Result<(), ()>,b: Result<(), E1>,c: Result<E1, ()>,- d: Result<(), ()>,+ d: Result<(u32,), (u32,)>,e: Result<u32, V1>,f: Result<wasmtime::component::__internal::String,@@ -675,7 +678,7 @@ pub mod foo {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -908,7 +911,7 @@ pub mod foo {arg5,): (Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1036,7 +1039,7 @@ pub mod foo {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -1368,21 +1371,24 @@ pub mod exports {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]- pub struct Empty {}+ pub struct Empty {+ #[component(name = "a")]+ pub a: u32,+ }impl core::fmt::Debug for Empty {fn fmt(&self,f: &mut core::fmt::Formatter<'_>,) -> core::fmt::Result {- f.debug_struct("Empty").finish()+ f.debug_struct("Empty").field("a", &self.a).finish()}}const _: () = {assert!(- 0 == < Empty as wasmtime::component::ComponentType >::SIZE32+ 4 == < Empty as wasmtime::component::ComponentType >::SIZE32);assert!(- 1 == < Empty as wasmtime::component::ComponentType >::ALIGN32+ 4 == < Empty as wasmtime::component::ComponentType >::ALIGN32);};#[derive(wasmtime::component::ComponentType)]@@ -1837,7 +1843,7 @@ pub mod exports {.get_typed_func::<(Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1852,7 +1858,7 @@ pub mod exports {((Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -1873,7 +1879,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, &V1>,Result<&str, &[u8]>,),@@ -1888,7 +1894,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -2159,7 +2165,7 @@ pub mod exports {) -> wasmtime::component::TypedFunc<(Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -2171,7 +2177,7 @@ pub mod exports {wasmtime::component::TypedFunc::<(Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -2185,7 +2191,7 @@ pub mod exports {&self,mut store: S,arg0: Option<bool>,- arg1: Option<()>,+ arg1: Option<(u32,)>,arg2: Option<u32>,arg3: Option<E1>,arg4: Option<f32>,@@ -2216,7 +2222,7 @@ pub mod exports {((Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -2230,7 +2236,7 @@ pub mod exports {((Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -2246,7 +2252,7 @@ pub mod exports {) -> wasmtime::Result<(Option<bool>,- Option<()>,+ Option<(u32,)>,Option<u32>,Option<E1>,Option<f32>,@@ -2318,7 +2324,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, &V1>,Result<&str, &[u8]>,),@@ -2330,7 +2336,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, &V1>,Result<&str, &[u8]>,),@@ -2344,7 +2350,7 @@ pub mod exports {arg0: Result<(), ()>,arg1: Result<(), E1>,arg2: Result<E1, ()>,- arg3: Result<(), ()>,+ arg3: Result<(u32,), (u32,)>,arg4: Result<u32, &V1>,arg5: Result<&str, &[u8]>,) -> wasmtime::Result<()>@@ -2375,7 +2381,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -2392,7 +2398,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,@@ -2411,7 +2417,7 @@ pub mod exports {Result<(), ()>,Result<(), E1>,Result<E1, ()>,- Result<(), ()>,+ Result<(u32,), (u32,)>,Result<u32, V1>,Result<wasmtime::component::__internal::String,diff --git a/crates/component-macro/tests/expanded/worlds-with-types.rs b/crates/component-macro/tests/expanded/worlds-with-types.rsindex 1094fb89aa..347e6be384 100644--- a/crates/component-macro/tests/expanded/worlds-with-types.rs+++ b/crates/component-macro/tests/expanded/worlds-with-types.rs@@ -13,15 +13,18 @@ const _: () = {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]-pub struct R {}+pub struct R {+ #[component(name = "a")]+ pub a: u32,+}impl core::fmt::Debug for R {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("R").finish()+ f.debug_struct("R").field("a", &self.a).finish()}}const _: () = {- assert!(0 == < R as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < R as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < R as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < R as wasmtime::component::ComponentType >::ALIGN32);};/// Auto-generated bindings for a pre-instantiated version of a/// component which implements the world `foo`.diff --git a/crates/component-macro/tests/expanded/worlds-with-types_async.rs b/crates/component-macro/tests/expanded/worlds-with-types_async.rsindex ac91c905ce..72df0a8114 100644--- a/crates/component-macro/tests/expanded/worlds-with-types_async.rs+++ b/crates/component-macro/tests/expanded/worlds-with-types_async.rs@@ -13,15 +13,18 @@ const _: () = {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]-pub struct R {}+pub struct R {+ #[component(name = "a")]+ pub a: u32,+}impl core::fmt::Debug for R {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("R").finish()+ f.debug_struct("R").field("a", &self.a).finish()}}const _: () = {- assert!(0 == < R as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < R as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < R as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < R as wasmtime::component::ComponentType >::ALIGN32);};/// Auto-generated bindings for a pre-instantiated version of a/// component which implements the world `foo`.diff --git a/crates/component-macro/tests/expanded/worlds-with-types_concurrent.rs b/crates/component-macro/tests/expanded/worlds-with-types_concurrent.rsindex 8e53ebc374..cbf3358b4d 100644--- a/crates/component-macro/tests/expanded/worlds-with-types_concurrent.rs+++ b/crates/component-macro/tests/expanded/worlds-with-types_concurrent.rs@@ -13,15 +13,18 @@ const _: () = {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]-pub struct R {}+pub struct R {+ #[component(name = "a")]+ pub a: u32,+}impl core::fmt::Debug for R {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("R").finish()+ f.debug_struct("R").field("a", &self.a).finish()}}const _: () = {- assert!(0 == < R as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < R as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < R as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < R as wasmtime::component::ComponentType >::ALIGN32);};/// Auto-generated bindings for a pre-instantiated version of a/// component which implements the world `foo`.diff --git a/crates/component-macro/tests/expanded/worlds-with-types_tracing_async.rs b/crates/component-macro/tests/expanded/worlds-with-types_tracing_async.rsindex 37fd13c764..bfd2609a10 100644--- a/crates/component-macro/tests/expanded/worlds-with-types_tracing_async.rs+++ b/crates/component-macro/tests/expanded/worlds-with-types_tracing_async.rs@@ -13,15 +13,18 @@ const _: () = {#[derive(wasmtime::component::Lower)]#[component(record)]#[derive(Clone, Copy)]-pub struct R {}+pub struct R {+ #[component(name = "a")]+ pub a: u32,+}impl core::fmt::Debug for R {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {- f.debug_struct("R").finish()+ f.debug_struct("R").field("a", &self.a).finish()}}const _: () = {- assert!(0 == < R as wasmtime::component::ComponentType >::SIZE32);- assert!(1 == < R as wasmtime::component::ComponentType >::ALIGN32);+ assert!(4 == < R as wasmtime::component::ComponentType >::SIZE32);+ assert!(4 == < R as wasmtime::component::ComponentType >::ALIGN32);};/// Auto-generated bindings for a pre-instantiated version of a/// component which implements the world `foo`.diff --git a/crates/environ/src/compile/module_environ.rs b/crates/environ/src/compile/module_environ.rsindex ce423a19f4..145abd34e6 100644--- a/crates/environ/src/compile/module_environ.rs+++ b/crates/environ/src/compile/module_environ.rs@@ -1169,6 +1169,8 @@ and for re-adding support for interface types you can see this issue:| wasmparser::Name::Data(_)| wasmparser::Name::Tag(_)| wasmparser::Name::Field(_)+ | wasmparser::Name::Parameter(_)+ | wasmparser::Name::TagParameter(_)| wasmparser::Name::Unknown { .. } => {}}}diff --git a/crates/environ/src/component/translate.rs b/crates/environ/src/component/translate.rsindex c5be8583e4..69492d9e43 100644--- a/crates/environ/src/component/translate.rs+++ b/crates/environ/src/component/translate.rs@@ -1327,6 +1327,12 @@ impl<'a, 'data> Translator<'a, 'data> {core_func_index += 1;LocalInitializer::ThreadYieldThenPromote { func }}+ wasmparser::CanonicalFunction::StreamForward { .. } => {+ bail!("unimplemented stream.forward")+ }+ wasmparser::CanonicalFunction::FutureForward { .. } => {+ bail!("unimplemented stream.forward")+ }};self.result.initializers.push(init);}diff --git a/crates/environ/src/types.rs b/crates/environ/src/types.rsindex c3c5b1f759..5b78cbcad3 100644--- a/crates/environ/src/types.rs+++ b/crates/environ/src/types.rs@@ -2572,9 +2572,16 @@ pub trait TypeConvert {}fn convert_sub_type(&self, ty: &wasmparser::SubType) -> WasmResult<WasmSubType> {+ let supertype = match &ty.supertype_idxs[..] {+ [] => None,+ [i] => Some(self.lookup_type_index(i.unpack())),+ [_, _, ..] => {+ return Err(wasm_unsupported!("multiple supertypes"));+ }+ };Ok(WasmSubType {is_final: ty.is_final,- supertype: ty.supertype_idx.map(|i| self.lookup_type_index(i.unpack())),+ supertype,composite_type: self.convert_composite_type(&ty.composite_type)?,})}diff --git a/crates/fuzzing/src/generators/gc_access.rs b/crates/fuzzing/src/generators/gc_access.rsindex fa075a70c7..bf078dc5f8 100644--- a/crates/fuzzing/src/generators/gc_access.rs+++ b/crates/fuzzing/src/generators/gc_access.rs@@ -390,7 +390,7 @@ impl<'a> Emitter<'a> {};types.ty().subtype(&wasm_encoder::SubType {is_final: true,- supertype_idx: None,+ supertype_idxs: Default::default(),composite_type: wasm_encoder::CompositeType {inner: obj_composite,shared: false,@@ -404,7 +404,7 @@ impl<'a> Emitter<'a> {let fi = self.filler_type.unwrap();types.ty().subtype(&wasm_encoder::SubType {is_final: true,- supertype_idx: None,+ supertype_idxs: Default::default(),composite_type: wasm_encoder::CompositeType {inner: wasm_encoder::CompositeInnerType::Struct(wasm_encoder::StructType {fields: Box::new([wasm_encoder::FieldType {@@ -429,7 +429,7 @@ impl<'a> Emitter<'a> {self.nested_obj_type = Some(types.len());types.ty().subtype(&wasm_encoder::SubType {is_final: true,- supertype_idx: None,+ supertype_idxs: Default::default(),composite_type: wasm_encoder::CompositeType {inner: wasm_encoder::CompositeInnerType::Struct(wasm_encoder::StructType {fields: Box::new([]),diff --git a/crates/fuzzing/src/generators/gc_ops/ops.rs b/crates/fuzzing/src/generators/gc_ops/ops.rsindex d64fcf32e5..3e5d54718c 100644--- a/crates/fuzzing/src/generators/gc_ops/ops.rs+++ b/crates/fuzzing/src/generators/gc_ops/ops.rs@@ -237,7 +237,11 @@ impl GcOps {};wasm_encoder::SubType {is_final: def.is_final,- supertype_idx: def.supertype.map(|st| type_ids_to_index[&st]),+ supertype_idxs: def+ .supertype+ .map(|st| type_ids_to_index[&st])+ .into_iter()+ .collect(),composite_type: wasm_encoder::CompositeType {inner,shared: false,diff --git a/crates/test-util/src/wast.rs b/crates/test-util/src/wast.rsindex 56898dc78a..204fceb5e0 100644--- a/crates/test-util/src/wast.rs+++ b/crates/test-util/src/wast.rs@@ -577,13 +577,10 @@ impl WastTest {return true;}- // Waiting for bytecodealliance/wasm-tools#2664 zero-length compact imports,- // as well as the Extended Name Section Proposal.+ // Wasmtime doesn't implement `assert_{invalid,malformed}_custom`let unsupported = [- "spec_testsuite/proposals/compact-import-section/imports-compact.wast","spec_testsuite/proposals/extended-name-section/custom/name_annot.wast","spec_testsuite/proposals/extended-name-section/custom/name.wast",- "spec_testsuite/type-subtyping.wast",];if unsupported.iter().any(|part| self.path.ends_with(part)) {return true;diff --git a/crates/wit-bindgen/src/config.rs b/crates/wit-bindgen/src/config.rsindex def8fc7e09..831fb4660f 100644--- a/crates/wit-bindgen/src/config.rs+++ b/crates/wit-bindgen/src/config.rs@@ -77,7 +77,13 @@ impl FunctionConfig {FunctionKind::Freestanding| FunctionKind::Method(_)| FunctionKind::Static(_)- | FunctionKind::Constructor(_) => {}+ | FunctionKind::Constructor(_)+ | FunctionKind::Getter+ | FunctionKind::Setter+ | FunctionKind::MethodGetter(_)+ | FunctionKind::MethodSetter(_)+ | FunctionKind::StaticGetter(_)+ | FunctionKind::StaticSetter(_) => {}FunctionKind::AsyncFreestanding| FunctionKind::AsyncMethod(_)diff --git a/crates/wit-bindgen/src/lib.rs b/crates/wit-bindgen/src/lib.rsindex fc3ed1b164..d0c666a51e 100644--- a/crates/wit-bindgen/src/lib.rs+++ b/crates/wit-bindgen/src/lib.rs@@ -7,7 +7,7 @@use crate::rust::{RustGenerator, TypeMode, to_rust_ident, to_rust_upper_camel_case};use crate::types::{TypeInfo, Types};-use anyhow::bail;+use anyhow::{Result, bail};use heck::*;use indexmap::{IndexMap, IndexSet};use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};@@ -439,13 +439,13 @@ impl Wasmtime {let world = &resolve.worlds[id];for (name, import) in world.imports.iter() {if !self.opts.only_interfaces || matches!(import, WorldItem::Interface { .. }) {- self.import(resolve, name, import);+ self.import(resolve, name, import)?;}}for (name, export) in world.exports.iter() {if !self.opts.only_interfaces || matches!(export, WorldItem::Interface { .. }) {- self.export(resolve, name, export);+ self.export(resolve, name, export)?;}}self.generate_named_imports(resolve)?;@@ -500,7 +500,7 @@ impl Wasmtime {"#[allow(unused_imports)] use {wt}::component::__internal::Box;\n"));let key_name = resolve.name_world_key(&key);- generator.generate_add_to_linker(id, &key_name);+ generator.generate_add_to_linker(id, &key_name)?;let body = String::from(mem::take(&mut generator.src));let interface_name = to_rust_ident(resolve.interfaces[id].name.as_ref().unwrap());let body = format!("pub mod {interface_name} {{\n{body}\n}}");@@ -510,7 +510,7 @@ impl Wasmtime {Ok(())}- fn import(&mut self, resolve: &Resolve, name: &WorldKey, item: &WorldItem) {+ fn import(&mut self, resolve: &Resolve, name: &WorldKey, item: &WorldItem) -> Result<()> {match item {WorldItem::Function(func) => {self.world_import_functions.push(func.clone());@@ -524,14 +524,14 @@ impl Wasmtime {Some(id) => *id,None => {self.interfaces_for_implements.insert(og_interface, *id);- self.import_interface(resolve, &WorldKey::Interface(*id), *id, false);+ self.import_interface(resolve, &WorldKey::Interface(*id), *id, false)?;*id}};self.world_implements_interfaces.push((kebab.to_string(), implements));} else {- self.import_interface(resolve, name, *id, true);+ self.import_interface(resolve, name, *id, true)?;}}WorldItem::Type { id, .. } => {@@ -540,11 +540,12 @@ impl Wasmtime {WorldKey::Interface(_) => unreachable!(),};let mut generator = InterfaceGenerator::new(self, resolve);- generator.define_type(name, *id);+ generator.define_type(name, *id)?;let body = mem::take(&mut generator.src);self.src.push_str(&body);}- };+ }+ Ok(())}fn import_interface(@@ -553,7 +554,7 @@ impl Wasmtime {name: &WorldKey,id: InterfaceId,in_world: bool,- ) {+ ) -> Result<()> {let mut generator = InterfaceGenerator::new(self, resolve);generator.current_interface = Some((id, name, InterfaceKind::Import));@@ -593,9 +594,9 @@ impl Wasmtime {// If this interface is not remapped then it's time to// actually generate bindings here.generator.generator.interface_link_options[&id].write_struct(&mut generator.src);- generator.types(id);+ generator.types(id)?;let key_name = resolve.name_world_key(name);- generator.generate_add_to_linker(id, &key_name);+ generator.generate_add_to_linker(id, &key_name)?;let module = &generator.src[..];let wt = generator.generator.wasmtime_path();@@ -626,9 +627,10 @@ impl Wasmtime {let interface_path = self.import_interface_path(&id);self.interface_link_options[&id].write_impl_from_world(&mut self.src, &interface_path);+ Ok(())}- fn export(&mut self, resolve: &Resolve, name: &WorldKey, item: &WorldItem) {+ fn export(&mut self, resolve: &Resolve, name: &WorldKey, item: &WorldItem) -> Result<()> {let wt = self.wasmtime_path();let mut generator = InterfaceGenerator::new(self, resolve);let field;@@ -638,13 +640,13 @@ impl Wasmtime {let get_index;match item {WorldItem::Function(func) => {- generator.define_rust_guest_export(resolve, None, func);+ generator.define_rust_guest_export(resolve, None, func)?;let body = mem::take(&mut generator.src).into();- load = generator.extract_typed_function(func).1;+ load = generator.extract_typed_function(func)?.1;assert!(generator.src.is_empty());generator.generator.exports.funcs.push(body);ty_index = format!("{wt}::component::ComponentExportIndex");- field = func_field_name(resolve, func);+ field = func_field_name(resolve, func)?;ty = format!("{wt}::component::Func");let sig = generator.typedfunc_sig(func, TypeMode::AllBorrowed("'_"));let typecheck = format!(@@ -674,7 +676,7 @@ impl Wasmtime {.generator.name_interface(resolve, *id, name, InterfaceKind::Export);generator.current_interface = Some((*id, name, InterfaceKind::Export));- generator.types(*id);+ generator.types(*id)?;let struct_name = "Guest";let iface = &resolve.interfaces[*id];let iface_name = match name {@@ -687,7 +689,7 @@ impl Wasmtime {uwriteln!(generator.src,"{}: {wt}::component::Func,",- func_field_name(resolve, func)+ func_field_name(resolve, func)?);}uwriteln!(generator.src, "}}");@@ -698,7 +700,7 @@ impl Wasmtime {uwriteln!(generator.src,"{}: {wt}::component::ComponentExportIndex,",- func_field_name(resolve, func)+ func_field_name(resolve, func)?);}uwriteln!(generator.src, "}}");@@ -732,7 +734,7 @@ pub fn new<_T>();let mut fields = Vec::new();for (_, func) in iface.functions.iter() {- let name = func_field_name(resolve, func);+ let name = func_field_name(resolve, func)?;uwriteln!(generator.src, "let {name} = lookup(\"{}\")?;", func.name);fields.push(name);}@@ -760,7 +762,7 @@ pub fn new<_T>();let mut fields = Vec::new();for (_, func) in iface.functions.iter() {- let (name, getter) = generator.extract_typed_function(func);+ let (name, getter) = generator.extract_typed_function(func)?;uwriteln!(generator.src, "let {name} = {getter};");fields.push(name);}@@ -778,7 +780,7 @@ pub fn new<_T>(for (_, func) in iface.functions.iter() {match func.kind.resource() {None => {- generator.define_rust_guest_export(resolve, Some(name), func);+ generator.define_rust_guest_export(resolve, Some(name), func)?;}Some(id) => {resource_methods.entry(id).or_insert(Vec::new()).push(func);@@ -805,7 +807,7 @@ pub fn new<_T>(let camel = resource_name.to_upper_camel_case();uwriteln!(generator.src, "impl Guest{camel}<'_> {{");for method in methods {- generator.define_rust_guest_export(resolve, Some(name), method);+ generator.define_rust_guest_export(resolve, Some(name), method)?;}uwriteln!(generator.src, "}}");}@@ -873,9 +875,10 @@ pub fn new<_T>(},);assert!(prev.is_none());+ Ok(())}- fn build_world_struct(&mut self, resolve: &Resolve, world: WorldId) {+ fn build_world_struct(&mut self, resolve: &Resolve, world: WorldId) -> Result<()> {let wt = self.wasmtime_path();let world_name = &resolve.worlds[world].name;let camel = to_rust_upper_camel_case(&world_name);@@ -1014,7 +1017,7 @@ impl<_T: Send + 'static> {camel}Pre<_T> {{}self.src.push_str("}\n");- let world_trait = self.world_imports_trait(resolve, world);+ let world_trait = self.world_imports_trait(resolve, world)?;uwriteln!(self.src, "const _: () = {{");@@ -1114,7 +1117,7 @@ impl<_T: Send + 'static> {camel}Pre<_T> {{",);}- self.world_add_to_linker(resolve, world, world_trait.as_ref());+ self.world_add_to_linker(resolve, world, world_trait.as_ref())?;for func in self.exports.funcs.iter() {self.src.push_str(func);@@ -1123,6 +1126,7 @@ impl<_T: Send + 'static> {camel}Pre<_T> {{uwriteln!(self.src, "}}"); // close `impl {camel}`uwriteln!(self.src, "}};"); // close `const _: () = ...+ Ok(())}fn finish(&mut self, resolve: &Resolve, world: WorldId) -> anyhow::Result<String> {@@ -1142,7 +1146,7 @@ impl<_T: Send + 'static> {camel}Pre<_T> {{}if !self.opts.only_interfaces {- self.build_world_struct(resolve, world)+ self.build_world_struct(resolve, world)?;}self.opts.imports.assert_all_rules_used("imports")?;@@ -1168,6 +1172,7 @@ impl<_T: Send + 'static> {camel}Pre<_T> {{world,wit_component::StringEncoding::UTF8,None,+ false,)?;uwriteln!(self.src,@@ -1437,9 +1442,13 @@ impl Wasmtime {!self.world_import_functions.is_empty() || get_world_resources(resolve, world).count() > 0}- fn world_imports_trait(&mut self, resolve: &Resolve, world: WorldId) -> Option<GeneratedTrait> {+ fn world_imports_trait(+ &mut self,+ resolve: &Resolve,+ world: WorldId,+ ) -> Result<Option<GeneratedTrait>> {if !self.has_world_imports_trait(resolve, world) {- return None;+ return Ok(None);}let world_camel = to_rust_upper_camel_case(&resolve.worlds[world].name);@@ -1454,10 +1463,10 @@ impl Wasmtime {.collect::<Vec<_>>(),&[],&get_world_resources(resolve, world).collect::<Vec<_>>(),- );+ )?;let src = String::from(mem::take(&mut generator.src));self.src.push_str(&src);- Some(generated_trait)+ Ok(Some(generated_trait))}fn import_interface_paths(&self) -> Vec<(InterfaceId, String, Option<String>)> {@@ -1531,10 +1540,10 @@ impl Wasmtime {resolve: &Resolve,world: WorldId,world_trait: Option<&GeneratedTrait>,- ) {+ ) -> Result<()> {let has_world_imports_trait = self.has_world_imports_trait(resolve, world);if self.import_interfaces.is_empty() && !has_world_imports_trait {- return;+ return Ok(());}let (options_param, options_arg) = if self.world_link_options.has_any() {@@ -1590,7 +1599,7 @@ impl Wasmtime {}for f in self.world_import_functions.clone() {let mut generator = InterfaceGenerator::new(self, resolve);- generator.generate_add_function_to_linker(TypeOwner::World(world), &f, "linker");+ generator.generate_add_function_to_linker(TypeOwner::World(world), &f, "linker")?;let src = String::from(generator.src);self.src.push_str(&src);self.src.push_str("\n");@@ -1674,6 +1683,7 @@ impl Wasmtime {}gate.close(&mut self.src);uwriteln!(self.src, "Ok(())\n}}");+ Ok(())}fn generate_add_resource_to_linker(@@ -1803,13 +1813,14 @@ impl<'a> InterfaceGenerator<'a> {}}- fn types(&mut self, id: InterfaceId) {+ fn types(&mut self, id: InterfaceId) -> Result<()> {for (name, id) in self.resolve.interfaces[id].types.iter() {- self.define_type(name, *id);+ self.define_type(name, *id)?;}+ Ok(())}- fn define_type(&mut self, name: &str, id: TypeId) {+ fn define_type(&mut self, name: &str, id: TypeId) -> Result<()> {let ty = &self.resolve.types[id];match &ty.kind {TypeDefKind::Record(record) => self.type_record(id, name, record, &ty.docs),@@ -1824,13 +1835,14 @@ impl<'a> InterfaceGenerator<'a> {TypeDefKind::Future(t) => self.type_future(id, name, t.as_ref(), &ty.docs),TypeDefKind::Stream(t) => self.type_stream(id, name, t.as_ref(), &ty.docs),TypeDefKind::Handle(handle) => self.type_handle(id, name, handle, &ty.docs),- TypeDefKind::Resource => self.type_resource(id, name, ty, &ty.docs),+ TypeDefKind::Resource => self.type_resource(id, name, ty, &ty.docs)?,TypeDefKind::Map(k, v) => self.type_map(id, name, k, v, &ty.docs),TypeDefKind::Unknown => unreachable!(),TypeDefKind::FixedLengthList(elem, size) => {self.type_fixed_length_list(id, name, elem, *size, &ty.docs)}}+ Ok(())}fn type_handle(&mut self, id: TypeId, name: &str, handle: &Handle, docs: &Docs) {@@ -1842,7 +1854,13 @@ impl<'a> InterfaceGenerator<'a> {self.assert_type(id, &name);}- fn type_resource(&mut self, id: TypeId, name: &str, _resource: &TypeDef, docs: &Docs) {+ fn type_resource(+ &mut self,+ id: TypeId,+ name: &str,+ _resource: &TypeDef,+ docs: &Docs,+ ) -> Result<()> {let camel = name.to_upper_camel_case();let wt = self.generator.wasmtime_path();@@ -1880,7 +1898,7 @@ impl<'a> InterfaceGenerator<'a> {&functions,&[ExtraTraitMethod::ResourceDrop { name }],&[],- );+ )?;self.all_func_flags |= trait_.all_func_flags;} else {self.rustdoc(docs);@@ -1895,6 +1913,7 @@ impl<'a> InterfaceGenerator<'a> {");}+ Ok(())}fn type_record(&mut self, id: TypeId, _name: &str, record: &Record, docs: &Docs) {@@ -2536,7 +2555,7 @@ impl<'a> InterfaceGenerator<'a> {(self.path_to_interface(owner), trappable_error_id)}- fn generate_add_to_linker(&mut self, id: InterfaceId, name: &str) {+ fn generate_add_to_linker(&mut self, id: InterfaceId, name: &str) -> Result<()> {let iface = &self.resolve.interfaces[id];let owner = TypeOwner::Interface(id);let wt = self.generator.wasmtime_path();@@ -2612,7 +2631,7 @@ impl<'a> InterfaceGenerator<'a> {name: resource_name,}],&[],- );+ )?;self.all_func_flags |= trait_.all_func_flags;}}@@ -2635,7 +2654,7 @@ impl<'a> InterfaceGenerator<'a> {.collect::<Vec<_>>(),&extra_functions,&get_resources(self.resolve, id).collect::<Vec<_>>(),- );+ )?;let opt_t_send_bound = if generated_trait.all_func_flags@@ -2709,7 +2728,7 @@ impl<'a> InterfaceGenerator<'a> {}for (_, func) in iface.functions.iter() {- self.generate_add_function_to_linker(owner, func, "inst");+ self.generate_add_function_to_linker(owner, func, "inst")?;}gate.close(&mut self.src);uwriteln!(self.src, "Ok(())");@@ -2780,6 +2799,7 @@ pub fn add_to_linker<T, D>();}}+ Ok(())}fn import_resource_drop_flags(&mut self, name: &str) -> FunctionFlags {@@ -2790,7 +2810,12 @@ pub fn add_to_linker<T, D>()}- fn generate_add_function_to_linker(&mut self, owner: TypeOwner, func: &Function, linker: &str) {+ fn generate_add_function_to_linker(+ &mut self,+ owner: TypeOwner,+ func: &Function,+ linker: &str,+ ) -> Result<()> {let flags = self.generator.opts.imports.flags(self.resolve,self.current_interface.map(|p| p.1),@@ -2813,12 +2838,13 @@ pub fn add_to_linker<T, D>(if self.named_import_id.is_some() {self.src.push_str("{ let id = id.clone(); ");}- self.generate_guest_import_closure(owner, func, flags);+ self.generate_guest_import_closure(owner, func, flags)?;if self.named_import_id.is_some() {self.src.push_str("}\n");}uwriteln!(self.src, ")?;");gate.close(&mut self.src);+ Ok(())}fn generate_guest_import_closure(@@ -2826,7 +2852,7 @@ pub fn add_to_linker<T, D>(owner: TypeOwner,func: &Function,flags: FunctionFlags,- ) {+ ) -> Result<()> {// Generate the closure that's passed to a `Linker`, the final piece of// codegen here.@@ -2933,7 +2959,7 @@ pub fn add_to_linker<T, D>(self.src.push_str("let host = &mut host_getter(caller.data_mut());\n");}- let func_name = rust_function_name(func);+ let func_name = rust_function_name(func)?;let host_trait = match func.kind.resource() {None => match owner {TypeOwner::World(id) => format!(@@ -3030,14 +3056,15 @@ pub fn add_to_linker<T, D>(}self.src.push_str("}\n");+ Ok(())}- fn generate_function_trait_sig(&mut self, func: &Function, flags: FunctionFlags) {+ fn generate_function_trait_sig(&mut self, func: &Function, flags: FunctionFlags) -> Result<()> {let wt = self.generator.wasmtime_path();self.rustdoc(&func.docs);self.push_str("fn ");- self.push_str(&rust_function_name(func));+ self.push_str(&rust_function_name(func)?);if func.kind.is_async() {uwrite!(self.src, "(accessor: &{wt}::component::Accessor<T, Self>, ");} else if flags.contains(FunctionFlags::STORE) {@@ -3062,6 +3089,7 @@ pub fn add_to_linker<T, D>(if flags.contains(FunctionFlags::ASYNC) {self.push_str("> + Send");}+ Ok(())}fn generate_function_params(&mut self, func: &Function) {@@ -3109,12 +3137,12 @@ pub fn add_to_linker<T, D>(}}- fn extract_typed_function(&mut self, func: &Function) -> (String, String) {- let snake = func_field_name(self.resolve, func);+ fn extract_typed_function(&mut self, func: &Function) -> Result<(String, String)> {+ let snake = func_field_name(self.resolve, func)?;let sig = self.typedfunc_sig(func, TypeMode::AllBorrowed("'_"));let extract =format!("*_instance.get_typed_func::<{sig}>(&mut store, &self.{snake})?.func()");- (snake, extract)+ Ok((snake, extract))}fn define_rust_guest_export(@@ -3122,7 +3150,7 @@ pub fn add_to_linker<T, D>(resolve: &Resolve,ns: Option<&WorldKey>,func: &Function,- ) {+ ) -> Result<()> {let flags = self.generator.opts.exports.flags(resolve, ns, func);let (async_, async__, await_) = if flags.contains(FunctionFlags::ASYNC) {("async", "_async", ".await")@@ -3158,7 +3186,7 @@ pub fn add_to_linker<T, D>(uwriteln!(self.src,"::new_unchecked(self{projection_to_func}.{})",- func_field_name(self.resolve, func),+ func_field_name(self.resolve, func)?,);self.src.push_str("}\n");self.src.push_str("}\n");@@ -3267,6 +3295,7 @@ pub fn add_to_linker<T, D>(// End function bodyself.src.push_str("}\n");+ Ok(())}fn rustdoc(&mut self, docs: &Docs) {@@ -3324,7 +3353,7 @@ pub fn add_to_linker<T, D>(functions: &[&Function],extra_functions: &[ExtraTraitMethod<'_>],resources: &[(TypeId, &str)],- ) -> GeneratedTrait {+ ) -> Result<GeneratedTrait> {let mut ret = GeneratedTrait::default();let wt = self.generator.wasmtime_path();let partition = self.partition_concurrent_funcs(functions.iter().copied());@@ -3410,7 +3439,7 @@ fn drop(accessor: {wt}::component::Access<T, Self>, {id_param}rep: {wt}::compone}for (func, flags) in partition.with_store.iter() {- self.generate_function_trait_sig(func, *flags);+ self.generate_function_trait_sig(func, *flags)?;self.push_str(";\n");}uwriteln!(self.src, "}}");@@ -3434,7 +3463,7 @@ fn drop(accessor: {wt}::component::Access<T, Self>, {id_param}rep: {wt}::compone);ret.name = trait_name.to_string();for (func, flags) in partition.without_store.iter() {- self.generate_function_trait_sig(func, *flags);+ self.generate_function_trait_sig(func, *flags)?;self.push_str(";\n");}@@ -3485,7 +3514,7 @@ fn convert_{snake}(&mut self, err: {root}{custom_name}) ->uwriteln!(self.src, "}}");if self.generator.opts.skip_mut_forwarding_impls {- return ret;+ return Ok(ret);}// Generate impl HostResource for &mut HostResource@@ -3499,7 +3528,7 @@ fn convert_{snake}(&mut self, err: {root}{custom_name}) ->"impl <_T: {trait_name} + ?Sized {maybe_send}> {trait_name} for &mut _T {{");for (func, flags) in partition.without_store.iter() {- self.generate_function_trait_sig(func, *flags);+ self.generate_function_trait_sig(func, *flags)?;uwriteln!(self.src, "{{");if flags.contains(FunctionFlags::ASYNC) {uwriteln!(self.src, "async move {{");@@ -3507,7 +3536,7 @@ fn convert_{snake}(&mut self, err: {root}{custom_name}) ->uwrite!(self.src,"{trait_name}::{}(*self,",- rust_function_name(func)+ rust_function_name(func)?,);if self.named_import_id.is_some() {self.src.push_str("id,");@@ -3573,7 +3602,7 @@ fn convert_{snake}(&mut self, err: {root}{custom_name}) ->}uwriteln!(self.src, "}}");- ret+ Ok(ret)}}@@ -3911,19 +3940,25 @@ fn resolve_type_definition_id(resolve: &Resolve, mut id: TypeId) -> TypeId {}}-fn rust_function_name(func: &Function) -> String {+fn rust_function_name(func: &Function) -> Result<String> {match func.kind {- FunctionKind::Constructor(_) => "new".to_string(),+ FunctionKind::Constructor(_) => Ok("new".to_string()),FunctionKind::Method(_)| FunctionKind::Static(_)| FunctionKind::AsyncMethod(_)| FunctionKind::AsyncStatic(_)| FunctionKind::Freestanding- | FunctionKind::AsyncFreestanding => to_rust_ident(func.item_name()),+ | FunctionKind::AsyncFreestanding => Ok(to_rust_ident(func.item_name())),+ FunctionKind::Getter+ | FunctionKind::Setter+ | FunctionKind::MethodGetter(_)+ | FunctionKind::MethodSetter(_)+ | FunctionKind::StaticGetter(_)+ | FunctionKind::StaticSetter(_) => bail!("unimplemented getter/setter"),}}-fn func_field_name(resolve: &Resolve, func: &Function) -> String {+fn func_field_name(resolve: &Resolve, func: &Function) -> Result<String> {let mut name = String::new();match func.kind {FunctionKind::Method(id) | FunctionKind::AsyncMethod(id) => {@@ -3942,9 +3977,15 @@ fn func_field_name(resolve: &Resolve, func: &Function) -> String {name.push_str("-");}FunctionKind::Freestanding | FunctionKind::AsyncFreestanding => {}+ FunctionKind::Getter+ | FunctionKind::Setter+ | FunctionKind::MethodGetter(_)+ | FunctionKind::MethodSetter(_)+ | FunctionKind::StaticGetter(_)+ | FunctionKind::StaticSetter(_) => bail!("unimplemented getter/setter"),}name.push_str(func.item_name());- name.to_snake_case()+ Ok(name.to_snake_case())}fn get_resources<'a>(diff --git a/supply-chain/imports.lock b/supply-chain/imports.lockindex 757e33d5e1..ba877dfc1a 100644--- a/supply-chain/imports.lock+++ b/supply-chain/imports.lock@@ -564,13 +564,6 @@ user-id = 1user-login = "alexcrichton"user-name = "Alex Crichton"-[[publisher.cap-primitives]]-version = "4.0.3"-when = "2026-08-20"-user-id = 6825-user-login = "sunfishcode"-user-name = "Dan Gohman"-[[publisher.cc]]version = "1.0.89"when = "2024-03-04"@@ -811,13 +804,6 @@ user-id = 4333user-login = "joshtriplett"user-name = "Josh Triplett"-[[publisher.fs-set-times]]-version = "0.20.3"-when = "2025-03-10"-user-id = 6825-user-login = "sunfishcode"-user-name = "Dan Gohman"-[[publisher.gimli]]version = "0.33.0"when = "2026-01-24"@@ -907,27 +893,6 @@ user-id = 539user-login = "cuviper"user-name = "Josh Stone"-[[publisher.io-extras]]-version = "0.19.0"-when = "2025-08-06"-user-id = 6825-user-login = "sunfishcode"-user-name = "Dan Gohman"--[[publisher.io-lifetimes]]-version = "2.0.3"-when = "2023-12-01"-user-id = 6825-user-login = "sunfishcode"-user-name = "Dan Gohman"--[[publisher.io-lifetimes]]-version = "3.0.1"-when = "2025-08-06"-user-id = 6825-user-login = "sunfishcode"-user-name = "Dan Gohman"-[[publisher.is-terminal]]version = "0.4.17"when = "2025-10-23"@@ -957,8 +922,8 @@ user-login = "alexcrichton"user-name = "Alex Crichton"[[publisher.json-from-wast]]-version = "0.259.0"-when = "2026-09-10"+version = "0.260.0"+when = "2026-09-30"trusted-publisher = "github:bytecodealliance/wasm-tools"[[publisher.libc]]@@ -1444,8 +1409,8 @@ user-login = "alexcrichton"user-name = "Alex Crichton"[[publisher.wasm-compose]]-version = "0.259.0"-when = "2026-09-10"+version = "0.260.0"+when = "2026-09-30"trusted-publisher = "github:bytecodealliance/wasm-tools"[[publisher.wasm-encoder]]@@ -1454,13 +1419,13 @@ when = "2026-01-06"trusted-publisher = "github:bytecodealliance/wasm-tools"[[publisher.wasm-encoder]]-version = "0.258.0"-when = "2026-08-24"+version = "0.259.0"+when = "2026-09-10"trusted-publisher = "github:bytecodealliance/wasm-tools"[[publisher.wasm-encoder]]-version = "0.259.0"-when = "2026-09-10"+version = "0.260.0"+when = "2026-09-30"trusted-publisher = "github:bytecodealliance/wasm-tools"[[publisher.wasm-metadata]]@@ -1470,18 +1435,18 @@ user-id = 73222user-login = "wasmtime-publish"[[publisher.wasm-metadata]]-version = "0.258.0"-when = "2026-08-24"+version = "0.259.0"+when = "2026-09-10"trusted-publisher = "github:bytecodealliance/wasm-tools"[[publisher.wasm-metadata]]-version = "0.259.0"-when = "2026-09-10"+version = "0.260.0"+when = "2026-09-30"trusted-publisher = "github:bytecodealliance/wasm-tools"[[publisher.wasm-wave]]-version = "0.259.0"-when = "2026-09-10"+version = "0.260.0"+when = "2026-09-30"trusted-publisher = "github:bytecodealliance/wasm-tools"[[publisher.wasmparser]]@@ -1490,18 +1455,18 @@ when = "2026-01-06"trusted-publisher = "github:bytecodealliance/wasm-tools"[[publisher.wasmparser]]-version = "0.258.0"-when = "2026-08-24"+version = "0.259.0"+when = "2026-09-10"trusted-publisher = "github:bytecodealliance/wasm-tools"[[publisher.wasmparser]]-version = "0.259.0"-when = "2026-09-10"+version = "0.260.0"+when = "2026-09-30"trusted-publisher = "github:bytecodealliance/wasm-tools"[[publisher.wasmprinter]]-version = "0.259.0"-when = "2026-09-10"+version = "0.260.0"+when = "2026-09-30"trusted-publisher = "github:bytecodealliance/wasm-tools"[[publisher.wasmtime]]@@ -1655,13 +1620,13 @@ when = "2026-08-24"trusted-publisher = "github:bytecodealliance/wasmtime"[[publisher.wast]]-version = "259.0.0"-when = "2026-09-10"+version = "260.0.0"+when = "2026-09-30"trusted-publisher = "github:bytecodealliance/wasm-tools"[[publisher.wat]]-version = "1.259.0"-when = "2026-09-10"+version = "1.260.0"+when = "2026-09-30"trusted-publisher = "github:bytecodealliance/wasm-tools"[[publisher.wiggle]]@@ -1817,13 +1782,6 @@ user-id = 6743user-login = "epage"user-name = "Ed Page"-[[publisher.winx]]-version = "0.36.4"-when = "2024-12-04"-user-id = 6825-user-login = "sunfishcode"-user-name = "Dan Gohman"-[[publisher.wit-bindgen]]version = "0.43.0"when = "2025-06-24"@@ -1882,13 +1840,13 @@ when = "2026-01-06"trusted-publisher = "github:bytecodealliance/wasm-tools"[[publisher.wit-component]]-version = "0.258.0"-when = "2026-08-24"+version = "0.259.0"+when = "2026-09-10"trusted-publisher = "github:bytecodealliance/wasm-tools"[[publisher.wit-component]]-version = "0.259.0"-when = "2026-09-10"+version = "0.260.0"+when = "2026-09-30"trusted-publisher = "github:bytecodealliance/wasm-tools"[[publisher.wit-parser]]@@ -1897,13 +1855,13 @@ when = "2026-01-06"trusted-publisher = "github:bytecodealliance/wasm-tools"[[publisher.wit-parser]]-version = "0.258.0"-when = "2026-08-24"+version = "0.259.0"+when = "2026-09-10"trusted-publisher = "github:bytecodealliance/wasm-tools"[[publisher.wit-parser]]-version = "0.259.0"-when = "2026-09-10"+version = "0.260.0"+when = "2026-09-30"trusted-publisher = "github:bytecodealliance/wasm-tools"[[publisher.witx]]