From d7fc89a8edbfff46ca0e5322d8f093c0ab9c8258 Mon Sep 17 00:00:00 2001 From: "maple@max" Date: Sat, 14 Dec 2024 22:50:44 +0800 Subject: [PATCH 1/4] add async example --- .../component/bindgen_examples/_7_async.rs | 47 ++++++++++++ .../runtime/component/bindgen_examples/mod.rs | 72 +++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 crates/wasmtime/src/runtime/component/bindgen_examples/_7_async.rs diff --git a/crates/wasmtime/src/runtime/component/bindgen_examples/_7_async.rs b/crates/wasmtime/src/runtime/component/bindgen_examples/_7_async.rs new file mode 100644 index 000000000000..d9e798791fce --- /dev/null +++ b/crates/wasmtime/src/runtime/component/bindgen_examples/_7_async.rs @@ -0,0 +1,47 @@ +bindgen!({ + inline: r#" + package example:imported-resources; + + interface logging { + enum level { + debug, + info, + warn, + error, + } + + resource logger { + constructor(max-level: level); + + get-max-level: func() -> level; + set-max-level: func(level: level); + + log: func(level: level, msg: string); + } + } + + world import-some-resources { + import logging; + } + "#, + + async: true, // NEW + + with: { + // Specify that our host resource is going to point to the `MyLogger` + // which is defined just below this macro. + "example:imported-resources/logging/logger": MyLogger, + }, + + // Interactions with `ResourceTable` can possibly trap so enable the ability + // to return traps from generated functions. + trappable_imports: true, +}); + +/// A sample host-defined type which contains arbitrary host-defined data. +/// +/// In this case this is relatively simple but there's no restrictions on what +/// this type can hold other than that it must be `'static + Send`. +pub struct MyLogger { + pub max_level: example::imported_resources::logging::Level, +} diff --git a/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs b/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs index 638431c4506d..c1f110ea2c9c 100644 --- a/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs +++ b/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs @@ -486,3 +486,75 @@ pub mod _5_all_world_export_kinds; /// } /// ``` pub mod _6_exported_resources; + +/// Example of generating **async** bindings for imported resources in a world. +/// +/// Notable differences from [`_4_imported_resources`] are: +/// * [`async_trait`] is used. +/// * async functions are used +/// * enabled async in bindgen! macro +/// +/// See [wasi_async_example](https://github.com/bytecodealliance/wasmtime/tree/main/examples/wasi-async) for async function calls on a host. +/// +/// ```rust +/// use async_trait::async_trait; +/// use wasmtime::Result; +/// use wasmtime::component::{bindgen, ResourceTable, Resource}; +/// use example::imported_resources::logging::{Level, Host, HostLogger}; +/// +#[doc = include_str!("./_7_async.rs")] +/// +/// #[derive(Default)] +/// struct MyState { +/// // Manages the mapping of `MyLogger` structures to `Resource`. +/// table: ResourceTable, +/// } +/// +/// // There are no free-functions on `interface logging`, so this is an empty +/// // impl. +/// impl Host for MyState {} +/// +/// // This separate `HostLogger` trait serves to act as a namespace for just +/// // the `logger`-related resource methods. +/// #[async_trait] +/// impl HostLogger for MyState { +/// // A `constructor` in WIT maps to a `new` function in Rust. +/// async fn new(&mut self, max_level: Level) -> Result> { +/// let id = self.table.push(MyLogger { max_level })?; +/// Ok(id) +/// } +/// +/// async fn get_max_level(&mut self, logger: Resource) -> Result { +/// debug_assert!(!logger.owned()); +/// let logger = self.table.get(&logger)?; +/// Ok(logger.max_level) +/// } +/// +/// async fn set_max_level(&mut self, logger: Resource, level: Level) -> Result<()> { +/// debug_assert!(!logger.owned()); +/// let logger = self.table.get_mut(&logger)?; +/// logger.max_level = level; +/// Ok(()) +/// } +/// +/// async fn log(&mut self, logger: Resource, level: Level, msg: String) -> Result<()> { +/// debug_assert!(!logger.owned()); +/// let logger = self.table.get_mut(&logger)?; +/// if (level as u32) <= (logger.max_level as u32) { +/// println!("{msg}"); +/// } +/// Ok(()) +/// } +/// +/// async fn drop(&mut self, logger: Resource) -> Result<()> { +/// debug_assert!(logger.owned()); +/// let _logger: MyLogger = self.table.delete(logger)?; +/// // ... custom destruction logic here if necessary, otherwise +/// // a `Drop for MyLogger` would also work. +/// Ok(()) +/// } +/// } +/// +/// # fn main() {} +/// ``` +pub mod _7_async; From 37722e58a85070ab2890396d16b79e493dc5e53f Mon Sep 17 00:00:00 2001 From: "maple@max" Date: Fri, 20 Dec 2024 23:16:47 +0800 Subject: [PATCH 2/4] fix bindgen bug to make CI happy See https://github.com/bytecodealliance/wasmtime/pull/9822#issuecomment-2546851949 --- crates/wit-bindgen/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/wit-bindgen/src/lib.rs b/crates/wit-bindgen/src/lib.rs index 74687f9d673c..3d8d86bec3ff 100644 --- a/crates/wit-bindgen/src/lib.rs +++ b/crates/wit-bindgen/src/lib.rs @@ -516,7 +516,7 @@ impl Wasmtime { #[allow(clippy::all)] pub mod {snake} {{ #[allow(unused_imports)] - use {wt}::component::__internal::anyhow; + use {wt}::component::__internal::{{anyhow, Box}}; {module} }} @@ -742,7 +742,7 @@ fn _new( #[allow(clippy::all)] pub mod {snake} {{ #[allow(unused_imports)] - use {wt}::component::__internal::anyhow; + use {wt}::component::__internal::{{anyhow, Box}}; {module} }} @@ -1600,7 +1600,7 @@ impl Wasmtime { \"{name}\", {wt}::component::ResourceType::host::<{camel}>(), move |mut store, rep| {{ - std::boxed::Box::new(async move {{ + {wt}::component::__internal::Box::new(async move {{ Host{camel}::drop(&mut host_getter(store.data_mut()), {wt}::component::Resource::new_own(rep)).await }}) }}, From f619a3c43ee270b5bd6e7c149f8d737c45b63cf0 Mon Sep 17 00:00:00 2001 From: "maple@max" Date: Sat, 21 Dec 2024 01:34:57 +0800 Subject: [PATCH 3/4] update test expectations --- crates/component-macro/tests/expanded/char.rs | 4 ++-- .../tests/expanded/char_async.rs | 4 ++-- .../tests/expanded/char_tracing_async.rs | 4 ++-- .../tests/expanded/conventions.rs | 4 ++-- .../tests/expanded/conventions_async.rs | 4 ++-- .../expanded/conventions_tracing_async.rs | 4 ++-- .../tests/expanded/dead-code.rs | 4 ++-- .../tests/expanded/dead-code_async.rs | 4 ++-- .../tests/expanded/dead-code_tracing_async.rs | 4 ++-- .../component-macro/tests/expanded/flags.rs | 4 ++-- .../tests/expanded/flags_async.rs | 4 ++-- .../tests/expanded/flags_tracing_async.rs | 4 ++-- .../component-macro/tests/expanded/floats.rs | 4 ++-- .../tests/expanded/floats_async.rs | 4 ++-- .../tests/expanded/floats_tracing_async.rs | 4 ++-- .../tests/expanded/integers.rs | 4 ++-- .../tests/expanded/integers_async.rs | 4 ++-- .../tests/expanded/integers_tracing_async.rs | 4 ++-- .../component-macro/tests/expanded/lists.rs | 4 ++-- .../tests/expanded/lists_async.rs | 4 ++-- .../tests/expanded/lists_tracing_async.rs | 4 ++-- .../tests/expanded/many-arguments.rs | 4 ++-- .../tests/expanded/many-arguments_async.rs | 4 ++-- .../expanded/many-arguments_tracing_async.rs | 4 ++-- .../tests/expanded/multi-return.rs | 4 ++-- .../tests/expanded/multi-return_async.rs | 4 ++-- .../expanded/multi-return_tracing_async.rs | 4 ++-- .../tests/expanded/multiversion.rs | 8 +++---- .../tests/expanded/multiversion_async.rs | 8 +++---- .../expanded/multiversion_tracing_async.rs | 8 +++---- .../component-macro/tests/expanded/path1.rs | 2 +- .../tests/expanded/path1_async.rs | 2 +- .../tests/expanded/path1_tracing_async.rs | 2 +- .../component-macro/tests/expanded/path2.rs | 2 +- .../tests/expanded/path2_async.rs | 2 +- .../tests/expanded/path2_tracing_async.rs | 2 +- .../component-macro/tests/expanded/records.rs | 4 ++-- .../tests/expanded/records_async.rs | 4 ++-- .../tests/expanded/records_tracing_async.rs | 4 ++-- .../component-macro/tests/expanded/rename.rs | 4 ++-- .../tests/expanded/rename_async.rs | 4 ++-- .../tests/expanded/rename_tracing_async.rs | 4 ++-- .../tests/expanded/resources-export.rs | 10 ++++----- .../tests/expanded/resources-export_async.rs | 12 +++++----- .../resources-export_tracing_async.rs | 12 +++++----- .../tests/expanded/resources-import.rs | 14 ++++++------ .../tests/expanded/resources-import_async.rs | 22 +++++++++---------- .../resources-import_tracing_async.rs | 22 +++++++++---------- .../tests/expanded/share-types.rs | 6 ++--- .../tests/expanded/share-types_async.rs | 6 ++--- .../expanded/share-types_tracing_async.rs | 6 ++--- .../tests/expanded/simple-functions.rs | 4 ++-- .../tests/expanded/simple-functions_async.rs | 4 ++-- .../simple-functions_tracing_async.rs | 4 ++-- .../tests/expanded/simple-lists.rs | 4 ++-- .../tests/expanded/simple-lists_async.rs | 4 ++-- .../expanded/simple-lists_tracing_async.rs | 4 ++-- .../tests/expanded/simple-wasi.rs | 4 ++-- .../tests/expanded/simple-wasi_async.rs | 4 ++-- .../expanded/simple-wasi_tracing_async.rs | 4 ++-- .../tests/expanded/small-anonymous.rs | 4 ++-- .../tests/expanded/small-anonymous_async.rs | 4 ++-- .../expanded/small-anonymous_tracing_async.rs | 4 ++-- .../tests/expanded/smoke-export.rs | 2 +- .../tests/expanded/smoke-export_async.rs | 2 +- .../expanded/smoke-export_tracing_async.rs | 2 +- .../component-macro/tests/expanded/smoke.rs | 2 +- .../tests/expanded/smoke_async.rs | 2 +- .../tests/expanded/smoke_tracing_async.rs | 2 +- .../component-macro/tests/expanded/strings.rs | 4 ++-- .../tests/expanded/strings_async.rs | 4 ++-- .../tests/expanded/strings_tracing_async.rs | 4 ++-- .../tests/expanded/unstable-features.rs | 2 +- .../tests/expanded/unstable-features_async.rs | 6 ++--- .../unstable-features_tracing_async.rs | 6 ++--- .../tests/expanded/unversioned-foo.rs | 2 +- .../tests/expanded/unversioned-foo_async.rs | 2 +- .../expanded/unversioned-foo_tracing_async.rs | 2 +- .../tests/expanded/use-paths.rs | 8 +++---- .../tests/expanded/use-paths_async.rs | 8 +++---- .../tests/expanded/use-paths_tracing_async.rs | 8 +++---- .../tests/expanded/variants.rs | 4 ++-- .../tests/expanded/variants_async.rs | 4 ++-- .../tests/expanded/variants_tracing_async.rs | 4 ++-- crates/component-macro/tests/expanded/wat.rs | 2 +- .../tests/expanded/wat_async.rs | 2 +- .../tests/expanded/wat_tracing_async.rs | 2 +- .../tests/expanded/worlds-with-types.rs | 2 +- .../tests/expanded/worlds-with-types_async.rs | 2 +- .../worlds-with-types_tracing_async.rs | 2 +- 90 files changed, 209 insertions(+), 209 deletions(-) diff --git a/crates/component-macro/tests/expanded/char.rs b/crates/component-macro/tests/expanded/char.rs index c8e1b9436487..6ff749f08e7f 100644 --- a/crates/component-macro/tests/expanded/char.rs +++ b/crates/component-macro/tests/expanded/char.rs @@ -185,7 +185,7 @@ pub mod foo { #[allow(clippy::all)] pub mod chars { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub trait Host { /// A function that accepts a character fn take_char(&mut self, x: char) -> (); @@ -258,7 +258,7 @@ pub mod exports { #[allow(clippy::all)] pub mod chars { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { take_char: wasmtime::component::Func, return_char: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/char_async.rs b/crates/component-macro/tests/expanded/char_async.rs index e2bb10590177..6ec33d553aad 100644 --- a/crates/component-macro/tests/expanded/char_async.rs +++ b/crates/component-macro/tests/expanded/char_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod chars { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { /// A function that accepts a character @@ -275,7 +275,7 @@ pub mod exports { #[allow(clippy::all)] pub mod chars { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { take_char: wasmtime::component::Func, return_char: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/char_tracing_async.rs b/crates/component-macro/tests/expanded/char_tracing_async.rs index dc7caf15fc8d..4bfe835602de 100644 --- a/crates/component-macro/tests/expanded/char_tracing_async.rs +++ b/crates/component-macro/tests/expanded/char_tracing_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod chars { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { /// A function that accepts a character @@ -304,7 +304,7 @@ pub mod exports { #[allow(clippy::all)] pub mod chars { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { take_char: wasmtime::component::Func, return_char: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/conventions.rs b/crates/component-macro/tests/expanded/conventions.rs index 631be530d8b8..eb341bb8b471 100644 --- a/crates/component-macro/tests/expanded/conventions.rs +++ b/crates/component-macro/tests/expanded/conventions.rs @@ -187,7 +187,7 @@ pub mod foo { #[allow(clippy::all)] pub mod conventions { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -420,7 +420,7 @@ pub mod exports { #[allow(clippy::all)] pub mod conventions { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/conventions_async.rs b/crates/component-macro/tests/expanded/conventions_async.rs index f591169d80bf..29a87d8993da 100644 --- a/crates/component-macro/tests/expanded/conventions_async.rs +++ b/crates/component-macro/tests/expanded/conventions_async.rs @@ -194,7 +194,7 @@ pub mod foo { #[allow(clippy::all)] pub mod conventions { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -457,7 +457,7 @@ pub mod exports { #[allow(clippy::all)] pub mod conventions { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/conventions_tracing_async.rs b/crates/component-macro/tests/expanded/conventions_tracing_async.rs index ac89ef41c553..f6e24faf7fec 100644 --- a/crates/component-macro/tests/expanded/conventions_tracing_async.rs +++ b/crates/component-macro/tests/expanded/conventions_tracing_async.rs @@ -194,7 +194,7 @@ pub mod foo { #[allow(clippy::all)] pub mod conventions { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -617,7 +617,7 @@ pub mod exports { #[allow(clippy::all)] pub mod conventions { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/dead-code.rs b/crates/component-macro/tests/expanded/dead-code.rs index 30781af56403..23f775721411 100644 --- a/crates/component-macro/tests/expanded/dead-code.rs +++ b/crates/component-macro/tests/expanded/dead-code.rs @@ -174,7 +174,7 @@ pub mod a { #[allow(clippy::all)] pub mod interface_with_live_type { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -243,7 +243,7 @@ pub mod a { #[allow(clippy::all)] pub mod interface_with_dead_type { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub trait Host {} pub trait GetHost< T, diff --git a/crates/component-macro/tests/expanded/dead-code_async.rs b/crates/component-macro/tests/expanded/dead-code_async.rs index 9ae5d387835d..d18267dda9db 100644 --- a/crates/component-macro/tests/expanded/dead-code_async.rs +++ b/crates/component-macro/tests/expanded/dead-code_async.rs @@ -181,7 +181,7 @@ pub mod a { #[allow(clippy::all)] pub mod interface_with_live_type { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -258,7 +258,7 @@ pub mod a { #[allow(clippy::all)] pub mod interface_with_dead_type { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send {} pub trait GetHost< diff --git a/crates/component-macro/tests/expanded/dead-code_tracing_async.rs b/crates/component-macro/tests/expanded/dead-code_tracing_async.rs index fc670a943af6..70bb6392ccda 100644 --- a/crates/component-macro/tests/expanded/dead-code_tracing_async.rs +++ b/crates/component-macro/tests/expanded/dead-code_tracing_async.rs @@ -181,7 +181,7 @@ pub mod a { #[allow(clippy::all)] pub mod interface_with_live_type { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -271,7 +271,7 @@ pub mod a { #[allow(clippy::all)] pub mod interface_with_dead_type { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send {} pub trait GetHost< diff --git a/crates/component-macro/tests/expanded/flags.rs b/crates/component-macro/tests/expanded/flags.rs index c036a1a2d85b..456c9a239905 100644 --- a/crates/component-macro/tests/expanded/flags.rs +++ b/crates/component-macro/tests/expanded/flags.rs @@ -185,7 +185,7 @@ pub mod foo { #[allow(clippy::all)] pub mod flegs { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; wasmtime::component::flags!(Flag1 { #[component(name = "b0")] const B0; }); const _: () = { assert!(1 == < Flag1 as wasmtime::component::ComponentType >::SIZE32); @@ -446,7 +446,7 @@ pub mod exports { #[allow(clippy::all)] pub mod flegs { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; wasmtime::component::flags!( Flag1 { #[component(name = "b0")] const B0; } ); diff --git a/crates/component-macro/tests/expanded/flags_async.rs b/crates/component-macro/tests/expanded/flags_async.rs index d7f9786d0d75..a72508d8161a 100644 --- a/crates/component-macro/tests/expanded/flags_async.rs +++ b/crates/component-macro/tests/expanded/flags_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod flegs { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; wasmtime::component::flags!(Flag1 { #[component(name = "b0")] const B0; }); const _: () = { assert!(1 == < Flag1 as wasmtime::component::ComponentType >::SIZE32); @@ -473,7 +473,7 @@ pub mod exports { #[allow(clippy::all)] pub mod flegs { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; wasmtime::component::flags!( Flag1 { #[component(name = "b0")] const B0; } ); diff --git a/crates/component-macro/tests/expanded/flags_tracing_async.rs b/crates/component-macro/tests/expanded/flags_tracing_async.rs index 8bec37487115..f64b3d1aee44 100644 --- a/crates/component-macro/tests/expanded/flags_tracing_async.rs +++ b/crates/component-macro/tests/expanded/flags_tracing_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod flegs { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; wasmtime::component::flags!(Flag1 { #[component(name = "b0")] const B0; }); const _: () = { assert!(1 == < Flag1 as wasmtime::component::ComponentType >::SIZE32); @@ -585,7 +585,7 @@ pub mod exports { #[allow(clippy::all)] pub mod flegs { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; wasmtime::component::flags!( Flag1 { #[component(name = "b0")] const B0; } ); diff --git a/crates/component-macro/tests/expanded/floats.rs b/crates/component-macro/tests/expanded/floats.rs index 50f7b3ca973f..89079f828361 100644 --- a/crates/component-macro/tests/expanded/floats.rs +++ b/crates/component-macro/tests/expanded/floats.rs @@ -185,7 +185,7 @@ pub mod foo { #[allow(clippy::all)] pub mod floats { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub trait Host { fn f32_param(&mut self, x: f32) -> (); fn f64_param(&mut self, x: f64) -> (); @@ -275,7 +275,7 @@ pub mod exports { #[allow(clippy::all)] pub mod floats { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { f32_param: wasmtime::component::Func, f64_param: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/floats_async.rs b/crates/component-macro/tests/expanded/floats_async.rs index 268d10882964..28aa1cf735d3 100644 --- a/crates/component-macro/tests/expanded/floats_async.rs +++ b/crates/component-macro/tests/expanded/floats_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod floats { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { async fn f32_param(&mut self, x: f32) -> (); @@ -296,7 +296,7 @@ pub mod exports { #[allow(clippy::all)] pub mod floats { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { f32_param: wasmtime::component::Func, f64_param: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/floats_tracing_async.rs b/crates/component-macro/tests/expanded/floats_tracing_async.rs index 254cdef3d299..c2f6710e71fb 100644 --- a/crates/component-macro/tests/expanded/floats_tracing_async.rs +++ b/crates/component-macro/tests/expanded/floats_tracing_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod floats { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { async fn f32_param(&mut self, x: f32) -> (); @@ -354,7 +354,7 @@ pub mod exports { #[allow(clippy::all)] pub mod floats { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { f32_param: wasmtime::component::Func, f64_param: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/integers.rs b/crates/component-macro/tests/expanded/integers.rs index a0ea4d42e45e..fd4edcf6e1ab 100644 --- a/crates/component-macro/tests/expanded/integers.rs +++ b/crates/component-macro/tests/expanded/integers.rs @@ -185,7 +185,7 @@ pub mod foo { #[allow(clippy::all)] pub mod integers { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub trait Host { fn a1(&mut self, x: u8) -> (); fn a2(&mut self, x: i8) -> (); @@ -485,7 +485,7 @@ pub mod exports { #[allow(clippy::all)] pub mod integers { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { a1: wasmtime::component::Func, a2: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/integers_async.rs b/crates/component-macro/tests/expanded/integers_async.rs index e0dc621675bb..e253c03d1e07 100644 --- a/crates/component-macro/tests/expanded/integers_async.rs +++ b/crates/component-macro/tests/expanded/integers_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod integers { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { async fn a1(&mut self, x: u8) -> (); @@ -535,7 +535,7 @@ pub mod exports { #[allow(clippy::all)] pub mod integers { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { a1: wasmtime::component::Func, a2: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/integers_tracing_async.rs b/crates/component-macro/tests/expanded/integers_tracing_async.rs index b14b6f2d962c..e655716d2fd7 100644 --- a/crates/component-macro/tests/expanded/integers_tracing_async.rs +++ b/crates/component-macro/tests/expanded/integers_tracing_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod integers { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { async fn a1(&mut self, x: u8) -> (); @@ -800,7 +800,7 @@ pub mod exports { #[allow(clippy::all)] pub mod integers { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { a1: wasmtime::component::Func, a2: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/lists.rs b/crates/component-macro/tests/expanded/lists.rs index d5067c796dc5..bf131e0b4b01 100644 --- a/crates/component-macro/tests/expanded/lists.rs +++ b/crates/component-macro/tests/expanded/lists.rs @@ -185,7 +185,7 @@ pub mod foo { #[allow(clippy::all)] pub mod lists { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -963,7 +963,7 @@ pub mod exports { #[allow(clippy::all)] pub mod lists { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/lists_async.rs b/crates/component-macro/tests/expanded/lists_async.rs index 219a469f9548..897c81c118a9 100644 --- a/crates/component-macro/tests/expanded/lists_async.rs +++ b/crates/component-macro/tests/expanded/lists_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod lists { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -1074,7 +1074,7 @@ pub mod exports { #[allow(clippy::all)] pub mod lists { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/lists_tracing_async.rs b/crates/component-macro/tests/expanded/lists_tracing_async.rs index dece512b8e0a..5636086f7bd5 100644 --- a/crates/component-macro/tests/expanded/lists_tracing_async.rs +++ b/crates/component-macro/tests/expanded/lists_tracing_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod lists { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -1505,7 +1505,7 @@ pub mod exports { #[allow(clippy::all)] pub mod lists { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/many-arguments.rs b/crates/component-macro/tests/expanded/many-arguments.rs index 86db694f8323..615876268b88 100644 --- a/crates/component-macro/tests/expanded/many-arguments.rs +++ b/crates/component-macro/tests/expanded/many-arguments.rs @@ -185,7 +185,7 @@ pub mod foo { #[allow(clippy::all)] pub mod manyarg { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -444,7 +444,7 @@ pub mod exports { #[allow(clippy::all)] pub mod manyarg { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/many-arguments_async.rs b/crates/component-macro/tests/expanded/many-arguments_async.rs index 3a55a6565f58..a83a393c0b81 100644 --- a/crates/component-macro/tests/expanded/many-arguments_async.rs +++ b/crates/component-macro/tests/expanded/many-arguments_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod manyarg { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -463,7 +463,7 @@ pub mod exports { #[allow(clippy::all)] pub mod manyarg { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/many-arguments_tracing_async.rs b/crates/component-macro/tests/expanded/many-arguments_tracing_async.rs index ed87748a3f17..f7fe386b5907 100644 --- a/crates/component-macro/tests/expanded/many-arguments_tracing_async.rs +++ b/crates/component-macro/tests/expanded/many-arguments_tracing_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod manyarg { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -506,7 +506,7 @@ pub mod exports { #[allow(clippy::all)] pub mod manyarg { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/multi-return.rs b/crates/component-macro/tests/expanded/multi-return.rs index 7b42ddcaeb3c..dd0637fbeb4b 100644 --- a/crates/component-macro/tests/expanded/multi-return.rs +++ b/crates/component-macro/tests/expanded/multi-return.rs @@ -187,7 +187,7 @@ pub mod foo { #[allow(clippy::all)] pub mod multi_return { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub trait Host { fn mra(&mut self) -> (); fn mrb(&mut self) -> (); @@ -289,7 +289,7 @@ pub mod exports { #[allow(clippy::all)] pub mod multi_return { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { mra: wasmtime::component::Func, mrb: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/multi-return_async.rs b/crates/component-macro/tests/expanded/multi-return_async.rs index d0c44c782757..1b1821b149f3 100644 --- a/crates/component-macro/tests/expanded/multi-return_async.rs +++ b/crates/component-macro/tests/expanded/multi-return_async.rs @@ -194,7 +194,7 @@ pub mod foo { #[allow(clippy::all)] pub mod multi_return { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { async fn mra(&mut self) -> (); @@ -312,7 +312,7 @@ pub mod exports { #[allow(clippy::all)] pub mod multi_return { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { mra: wasmtime::component::Func, mrb: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/multi-return_tracing_async.rs b/crates/component-macro/tests/expanded/multi-return_tracing_async.rs index f24b6a347d29..a1060341e350 100644 --- a/crates/component-macro/tests/expanded/multi-return_tracing_async.rs +++ b/crates/component-macro/tests/expanded/multi-return_tracing_async.rs @@ -194,7 +194,7 @@ pub mod foo { #[allow(clippy::all)] pub mod multi_return { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { async fn mra(&mut self) -> (); @@ -377,7 +377,7 @@ pub mod exports { #[allow(clippy::all)] pub mod multi_return { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { mra: wasmtime::component::Func, mrb: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/multiversion.rs b/crates/component-macro/tests/expanded/multiversion.rs index 44d9e429237e..da50b12799ea 100644 --- a/crates/component-macro/tests/expanded/multiversion.rs +++ b/crates/component-macro/tests/expanded/multiversion.rs @@ -203,7 +203,7 @@ pub mod my { #[allow(clippy::all)] pub mod a { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub trait Host { fn x(&mut self) -> (); } @@ -254,7 +254,7 @@ pub mod my { #[allow(clippy::all)] pub mod a { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub trait Host { fn x(&mut self) -> (); } @@ -308,7 +308,7 @@ pub mod exports { #[allow(clippy::all)] pub mod a { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { x: wasmtime::component::Func, } @@ -408,7 +408,7 @@ pub mod exports { #[allow(clippy::all)] pub mod a { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { x: wasmtime::component::Func, } diff --git a/crates/component-macro/tests/expanded/multiversion_async.rs b/crates/component-macro/tests/expanded/multiversion_async.rs index 9d730e2f643c..6b5e7e94c90f 100644 --- a/crates/component-macro/tests/expanded/multiversion_async.rs +++ b/crates/component-macro/tests/expanded/multiversion_async.rs @@ -210,7 +210,7 @@ pub mod my { #[allow(clippy::all)] pub mod a { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { async fn x(&mut self) -> (); @@ -269,7 +269,7 @@ pub mod my { #[allow(clippy::all)] pub mod a { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { async fn x(&mut self) -> (); @@ -331,7 +331,7 @@ pub mod exports { #[allow(clippy::all)] pub mod a { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { x: wasmtime::component::Func, } @@ -434,7 +434,7 @@ pub mod exports { #[allow(clippy::all)] pub mod a { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { x: wasmtime::component::Func, } diff --git a/crates/component-macro/tests/expanded/multiversion_tracing_async.rs b/crates/component-macro/tests/expanded/multiversion_tracing_async.rs index 11fa4d6cbbcc..5ffea8eb89d0 100644 --- a/crates/component-macro/tests/expanded/multiversion_tracing_async.rs +++ b/crates/component-macro/tests/expanded/multiversion_tracing_async.rs @@ -210,7 +210,7 @@ pub mod my { #[allow(clippy::all)] pub mod a { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { async fn x(&mut self) -> (); @@ -282,7 +282,7 @@ pub mod my { #[allow(clippy::all)] pub mod a { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { async fn x(&mut self) -> (); @@ -357,7 +357,7 @@ pub mod exports { #[allow(clippy::all)] pub mod a { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { x: wasmtime::component::Func, } @@ -471,7 +471,7 @@ pub mod exports { #[allow(clippy::all)] pub mod a { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { x: wasmtime::component::Func, } diff --git a/crates/component-macro/tests/expanded/path1.rs b/crates/component-macro/tests/expanded/path1.rs index a4ce53636f65..834a00afedb8 100644 --- a/crates/component-macro/tests/expanded/path1.rs +++ b/crates/component-macro/tests/expanded/path1.rs @@ -172,7 +172,7 @@ pub mod paths { #[allow(clippy::all)] pub mod test { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub trait Host {} pub trait GetHost< T, diff --git a/crates/component-macro/tests/expanded/path1_async.rs b/crates/component-macro/tests/expanded/path1_async.rs index 45f121cdd893..852bd3c6d1df 100644 --- a/crates/component-macro/tests/expanded/path1_async.rs +++ b/crates/component-macro/tests/expanded/path1_async.rs @@ -179,7 +179,7 @@ pub mod paths { #[allow(clippy::all)] pub mod test { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send {} pub trait GetHost< diff --git a/crates/component-macro/tests/expanded/path1_tracing_async.rs b/crates/component-macro/tests/expanded/path1_tracing_async.rs index 45f121cdd893..852bd3c6d1df 100644 --- a/crates/component-macro/tests/expanded/path1_tracing_async.rs +++ b/crates/component-macro/tests/expanded/path1_tracing_async.rs @@ -179,7 +179,7 @@ pub mod paths { #[allow(clippy::all)] pub mod test { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send {} pub trait GetHost< diff --git a/crates/component-macro/tests/expanded/path2.rs b/crates/component-macro/tests/expanded/path2.rs index 5d9fba7b1ba0..fd9b5460a9e8 100644 --- a/crates/component-macro/tests/expanded/path2.rs +++ b/crates/component-macro/tests/expanded/path2.rs @@ -172,7 +172,7 @@ pub mod paths { #[allow(clippy::all)] pub mod test { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub trait Host {} pub trait GetHost< T, diff --git a/crates/component-macro/tests/expanded/path2_async.rs b/crates/component-macro/tests/expanded/path2_async.rs index 0e07fe478658..00286191ff2c 100644 --- a/crates/component-macro/tests/expanded/path2_async.rs +++ b/crates/component-macro/tests/expanded/path2_async.rs @@ -179,7 +179,7 @@ pub mod paths { #[allow(clippy::all)] pub mod test { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send {} pub trait GetHost< diff --git a/crates/component-macro/tests/expanded/path2_tracing_async.rs b/crates/component-macro/tests/expanded/path2_tracing_async.rs index 0e07fe478658..00286191ff2c 100644 --- a/crates/component-macro/tests/expanded/path2_tracing_async.rs +++ b/crates/component-macro/tests/expanded/path2_tracing_async.rs @@ -179,7 +179,7 @@ pub mod paths { #[allow(clippy::all)] pub mod test { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send {} pub trait GetHost< diff --git a/crates/component-macro/tests/expanded/records.rs b/crates/component-macro/tests/expanded/records.rs index 5a6fed8dcbd3..edca81d63efb 100644 --- a/crates/component-macro/tests/expanded/records.rs +++ b/crates/component-macro/tests/expanded/records.rs @@ -185,7 +185,7 @@ pub mod foo { #[allow(clippy::all)] pub mod records { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -523,7 +523,7 @@ pub mod exports { #[allow(clippy::all)] pub mod records { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/records_async.rs b/crates/component-macro/tests/expanded/records_async.rs index a7c2e82c405c..ee4e1647bacc 100644 --- a/crates/component-macro/tests/expanded/records_async.rs +++ b/crates/component-macro/tests/expanded/records_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod records { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -558,7 +558,7 @@ pub mod exports { #[allow(clippy::all)] pub mod records { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/records_tracing_async.rs b/crates/component-macro/tests/expanded/records_tracing_async.rs index 8bcfaffa0ea7..4e3ef134ffc8 100644 --- a/crates/component-macro/tests/expanded/records_tracing_async.rs +++ b/crates/component-macro/tests/expanded/records_tracing_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod records { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -719,7 +719,7 @@ pub mod exports { #[allow(clippy::all)] pub mod records { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/rename.rs b/crates/component-macro/tests/expanded/rename.rs index 40ad51574259..5870b202254f 100644 --- a/crates/component-macro/tests/expanded/rename.rs +++ b/crates/component-macro/tests/expanded/rename.rs @@ -173,7 +173,7 @@ pub mod foo { #[allow(clippy::all)] pub mod green { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Thing = i32; const _: () = { assert!(4 == < Thing as wasmtime::component::ComponentType >::SIZE32); @@ -213,7 +213,7 @@ pub mod foo { #[allow(clippy::all)] pub mod red { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Thing = super::super::super::foo::foo::green::Thing; const _: () = { assert!(4 == < Thing as wasmtime::component::ComponentType >::SIZE32); diff --git a/crates/component-macro/tests/expanded/rename_async.rs b/crates/component-macro/tests/expanded/rename_async.rs index e1966b08dc86..e61e45fff166 100644 --- a/crates/component-macro/tests/expanded/rename_async.rs +++ b/crates/component-macro/tests/expanded/rename_async.rs @@ -180,7 +180,7 @@ pub mod foo { #[allow(clippy::all)] pub mod green { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Thing = i32; const _: () = { assert!(4 == < Thing as wasmtime::component::ComponentType >::SIZE32); @@ -226,7 +226,7 @@ pub mod foo { #[allow(clippy::all)] pub mod red { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Thing = super::super::super::foo::foo::green::Thing; const _: () = { assert!(4 == < Thing as wasmtime::component::ComponentType >::SIZE32); diff --git a/crates/component-macro/tests/expanded/rename_tracing_async.rs b/crates/component-macro/tests/expanded/rename_tracing_async.rs index f8bc4e5e606c..48e94f988e6f 100644 --- a/crates/component-macro/tests/expanded/rename_tracing_async.rs +++ b/crates/component-macro/tests/expanded/rename_tracing_async.rs @@ -180,7 +180,7 @@ pub mod foo { #[allow(clippy::all)] pub mod green { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Thing = i32; const _: () = { assert!(4 == < Thing as wasmtime::component::ComponentType >::SIZE32); @@ -226,7 +226,7 @@ pub mod foo { #[allow(clippy::all)] pub mod red { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Thing = super::super::super::foo::foo::green::Thing; const _: () = { assert!(4 == < Thing as wasmtime::component::ComponentType >::SIZE32); diff --git a/crates/component-macro/tests/expanded/resources-export.rs b/crates/component-macro/tests/expanded/resources-export.rs index 2df3c228fa37..4414d8344ee2 100644 --- a/crates/component-macro/tests/expanded/resources-export.rs +++ b/crates/component-macro/tests/expanded/resources-export.rs @@ -247,7 +247,7 @@ pub mod foo { #[allow(clippy::all)] pub mod transitive_import { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub enum Y {} pub trait HostY { fn drop( @@ -312,7 +312,7 @@ pub mod exports { #[allow(clippy::all)] pub mod simple_export { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type A = wasmtime::component::ResourceAny; pub struct GuestA<'a> { funcs: &'a Guest, @@ -477,7 +477,7 @@ pub mod exports { #[allow(clippy::all)] pub mod export_using_import { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Y = super::super::super::super::foo::foo::transitive_import::Y; pub type A = wasmtime::component::ResourceAny; pub struct GuestA<'a> { @@ -651,7 +651,7 @@ pub mod exports { #[allow(clippy::all)] pub mod export_using_export1 { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type A = wasmtime::component::ResourceAny; pub struct GuestA<'a> { funcs: &'a Guest, @@ -763,7 +763,7 @@ pub mod exports { #[allow(clippy::all)] pub mod export_using_export2 { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type A = super::super::super::super::exports::foo::foo::export_using_export1::A; pub type B = wasmtime::component::ResourceAny; pub struct GuestB<'a> { diff --git a/crates/component-macro/tests/expanded/resources-export_async.rs b/crates/component-macro/tests/expanded/resources-export_async.rs index 09a3766b8731..af33fe54500a 100644 --- a/crates/component-macro/tests/expanded/resources-export_async.rs +++ b/crates/component-macro/tests/expanded/resources-export_async.rs @@ -254,7 +254,7 @@ pub mod foo { #[allow(clippy::all)] pub mod transitive_import { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub enum Y {} #[wasmtime::component::__internal::async_trait] pub trait HostY { @@ -298,7 +298,7 @@ pub mod foo { "y", wasmtime::component::ResourceType::host::(), move |mut store, rep| { - std::boxed::Box::new(async move { + wasmtime::component::__internal::Box::new(async move { HostY::drop( &mut host_getter(store.data_mut()), wasmtime::component::Resource::new_own(rep), @@ -330,7 +330,7 @@ pub mod exports { #[allow(clippy::all)] pub mod simple_export { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type A = wasmtime::component::ResourceAny; pub struct GuestA<'a> { funcs: &'a Guest, @@ -510,7 +510,7 @@ pub mod exports { #[allow(clippy::all)] pub mod export_using_import { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Y = super::super::super::super::foo::foo::transitive_import::Y; pub type A = wasmtime::component::ResourceAny; pub struct GuestA<'a> { @@ -699,7 +699,7 @@ pub mod exports { #[allow(clippy::all)] pub mod export_using_export1 { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type A = wasmtime::component::ResourceAny; pub struct GuestA<'a> { funcs: &'a Guest, @@ -816,7 +816,7 @@ pub mod exports { #[allow(clippy::all)] pub mod export_using_export2 { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type A = super::super::super::super::exports::foo::foo::export_using_export1::A; pub type B = wasmtime::component::ResourceAny; pub struct GuestB<'a> { diff --git a/crates/component-macro/tests/expanded/resources-export_tracing_async.rs b/crates/component-macro/tests/expanded/resources-export_tracing_async.rs index e25bebe52015..2e8f5eef898d 100644 --- a/crates/component-macro/tests/expanded/resources-export_tracing_async.rs +++ b/crates/component-macro/tests/expanded/resources-export_tracing_async.rs @@ -254,7 +254,7 @@ pub mod foo { #[allow(clippy::all)] pub mod transitive_import { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub enum Y {} #[wasmtime::component::__internal::async_trait] pub trait HostY { @@ -298,7 +298,7 @@ pub mod foo { "y", wasmtime::component::ResourceType::host::(), move |mut store, rep| { - std::boxed::Box::new(async move { + wasmtime::component::__internal::Box::new(async move { HostY::drop( &mut host_getter(store.data_mut()), wasmtime::component::Resource::new_own(rep), @@ -330,7 +330,7 @@ pub mod exports { #[allow(clippy::all)] pub mod simple_export { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type A = wasmtime::component::ResourceAny; pub struct GuestA<'a> { funcs: &'a Guest, @@ -537,7 +537,7 @@ pub mod exports { #[allow(clippy::all)] pub mod export_using_import { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Y = super::super::super::super::foo::foo::transitive_import::Y; pub type A = wasmtime::component::ResourceAny; pub struct GuestA<'a> { @@ -755,7 +755,7 @@ pub mod exports { #[allow(clippy::all)] pub mod export_using_export1 { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type A = wasmtime::component::ResourceAny; pub struct GuestA<'a> { funcs: &'a Guest, @@ -881,7 +881,7 @@ pub mod exports { #[allow(clippy::all)] pub mod export_using_export2 { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type A = super::super::super::super::exports::foo::foo::export_using_export1::A; pub type B = wasmtime::component::ResourceAny; pub struct GuestB<'a> { diff --git a/crates/component-macro/tests/expanded/resources-import.rs b/crates/component-macro/tests/expanded/resources-import.rs index cbea8b03f851..cd27d777f581 100644 --- a/crates/component-macro/tests/expanded/resources-import.rs +++ b/crates/component-macro/tests/expanded/resources-import.rs @@ -344,7 +344,7 @@ pub mod foo { #[allow(clippy::all)] pub mod resources { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub enum Bar {} pub trait HostBar { fn new(&mut self) -> wasmtime::component::Resource; @@ -860,7 +860,7 @@ pub mod foo { #[allow(clippy::all)] pub mod long_use_chain1 { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub enum A {} pub trait HostA { fn drop( @@ -920,7 +920,7 @@ pub mod foo { #[allow(clippy::all)] pub mod long_use_chain2 { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type A = super::super::super::foo::foo::long_use_chain1::A; pub trait Host {} pub trait GetHost< @@ -956,7 +956,7 @@ pub mod foo { #[allow(clippy::all)] pub mod long_use_chain3 { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type A = super::super::super::foo::foo::long_use_chain2::A; pub trait Host {} pub trait GetHost< @@ -992,7 +992,7 @@ pub mod foo { #[allow(clippy::all)] pub mod long_use_chain4 { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type A = super::super::super::foo::foo::long_use_chain3::A; pub trait Host { fn foo(&mut self) -> wasmtime::component::Resource; @@ -1042,7 +1042,7 @@ pub mod foo { #[allow(clippy::all)] pub mod transitive_interface_with_resource { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub enum Foo {} pub trait HostFoo { fn drop( @@ -1108,7 +1108,7 @@ pub mod exports { #[allow(clippy::all)] pub mod uses_resource_transitively { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Foo = super::super::super::super::foo::foo::transitive_interface_with_resource::Foo; pub struct Guest { handle: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/resources-import_async.rs b/crates/component-macro/tests/expanded/resources-import_async.rs index b54d0c283fdf..8e24f88d9a27 100644 --- a/crates/component-macro/tests/expanded/resources-import_async.rs +++ b/crates/component-macro/tests/expanded/resources-import_async.rs @@ -265,7 +265,7 @@ const _: () = { "world-resource", wasmtime::component::ResourceType::host::(), move |mut store, rep| { - std::boxed::Box::new(async move { + wasmtime::component::__internal::Box::new(async move { HostWorldResource::drop( &mut host_getter(store.data_mut()), wasmtime::component::Resource::new_own(rep), @@ -373,7 +373,7 @@ pub mod foo { #[allow(clippy::all)] pub mod resources { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub enum Bar {} #[wasmtime::component::__internal::async_trait] pub trait HostBar { @@ -554,7 +554,7 @@ pub mod foo { "bar", wasmtime::component::ResourceType::host::(), move |mut store, rep| { - std::boxed::Box::new(async move { + wasmtime::component::__internal::Box::new(async move { HostBar::drop( &mut host_getter(store.data_mut()), wasmtime::component::Resource::new_own(rep), @@ -957,7 +957,7 @@ pub mod foo { #[allow(clippy::all)] pub mod long_use_chain1 { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub enum A {} #[wasmtime::component::__internal::async_trait] pub trait HostA { @@ -1001,7 +1001,7 @@ pub mod foo { "a", wasmtime::component::ResourceType::host::(), move |mut store, rep| { - std::boxed::Box::new(async move { + wasmtime::component::__internal::Box::new(async move { HostA::drop( &mut host_getter(store.data_mut()), wasmtime::component::Resource::new_own(rep), @@ -1028,7 +1028,7 @@ pub mod foo { #[allow(clippy::all)] pub mod long_use_chain2 { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type A = super::super::super::foo::foo::long_use_chain1::A; #[wasmtime::component::__internal::async_trait] pub trait Host: Send {} @@ -1070,7 +1070,7 @@ pub mod foo { #[allow(clippy::all)] pub mod long_use_chain3 { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type A = super::super::super::foo::foo::long_use_chain2::A; #[wasmtime::component::__internal::async_trait] pub trait Host: Send {} @@ -1112,7 +1112,7 @@ pub mod foo { #[allow(clippy::all)] pub mod long_use_chain4 { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type A = super::super::super::foo::foo::long_use_chain3::A; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { @@ -1170,7 +1170,7 @@ pub mod foo { #[allow(clippy::all)] pub mod transitive_interface_with_resource { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub enum Foo {} #[wasmtime::component::__internal::async_trait] pub trait HostFoo { @@ -1215,7 +1215,7 @@ pub mod foo { "foo", wasmtime::component::ResourceType::host::(), move |mut store, rep| { - std::boxed::Box::new(async move { + wasmtime::component::__internal::Box::new(async move { HostFoo::drop( &mut host_getter(store.data_mut()), wasmtime::component::Resource::new_own(rep), @@ -1247,7 +1247,7 @@ pub mod exports { #[allow(clippy::all)] pub mod uses_resource_transitively { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Foo = super::super::super::super::foo::foo::transitive_interface_with_resource::Foo; pub struct Guest { handle: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/resources-import_tracing_async.rs b/crates/component-macro/tests/expanded/resources-import_tracing_async.rs index 3a5f6ed8aea2..5ce726f829b8 100644 --- a/crates/component-macro/tests/expanded/resources-import_tracing_async.rs +++ b/crates/component-macro/tests/expanded/resources-import_tracing_async.rs @@ -265,7 +265,7 @@ const _: () = { "world-resource", wasmtime::component::ResourceType::host::(), move |mut store, rep| { - std::boxed::Box::new(async move { + wasmtime::component::__internal::Box::new(async move { HostWorldResource::drop( &mut host_getter(store.data_mut()), wasmtime::component::Resource::new_own(rep), @@ -436,7 +436,7 @@ pub mod foo { #[allow(clippy::all)] pub mod resources { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub enum Bar {} #[wasmtime::component::__internal::async_trait] pub trait HostBar { @@ -617,7 +617,7 @@ pub mod foo { "bar", wasmtime::component::ResourceType::host::(), move |mut store, rep| { - std::boxed::Box::new(async move { + wasmtime::component::__internal::Box::new(async move { HostBar::drop( &mut host_getter(store.data_mut()), wasmtime::component::Resource::new_own(rep), @@ -1348,7 +1348,7 @@ pub mod foo { #[allow(clippy::all)] pub mod long_use_chain1 { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub enum A {} #[wasmtime::component::__internal::async_trait] pub trait HostA { @@ -1392,7 +1392,7 @@ pub mod foo { "a", wasmtime::component::ResourceType::host::(), move |mut store, rep| { - std::boxed::Box::new(async move { + wasmtime::component::__internal::Box::new(async move { HostA::drop( &mut host_getter(store.data_mut()), wasmtime::component::Resource::new_own(rep), @@ -1419,7 +1419,7 @@ pub mod foo { #[allow(clippy::all)] pub mod long_use_chain2 { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type A = super::super::super::foo::foo::long_use_chain1::A; #[wasmtime::component::__internal::async_trait] pub trait Host: Send {} @@ -1461,7 +1461,7 @@ pub mod foo { #[allow(clippy::all)] pub mod long_use_chain3 { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type A = super::super::super::foo::foo::long_use_chain2::A; #[wasmtime::component::__internal::async_trait] pub trait Host: Send {} @@ -1503,7 +1503,7 @@ pub mod foo { #[allow(clippy::all)] pub mod long_use_chain4 { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type A = super::super::super::foo::foo::long_use_chain3::A; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { @@ -1574,7 +1574,7 @@ pub mod foo { #[allow(clippy::all)] pub mod transitive_interface_with_resource { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub enum Foo {} #[wasmtime::component::__internal::async_trait] pub trait HostFoo { @@ -1619,7 +1619,7 @@ pub mod foo { "foo", wasmtime::component::ResourceType::host::(), move |mut store, rep| { - std::boxed::Box::new(async move { + wasmtime::component::__internal::Box::new(async move { HostFoo::drop( &mut host_getter(store.data_mut()), wasmtime::component::Resource::new_own(rep), @@ -1651,7 +1651,7 @@ pub mod exports { #[allow(clippy::all)] pub mod uses_resource_transitively { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Foo = super::super::super::super::foo::foo::transitive_interface_with_resource::Foo; pub struct Guest { handle: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/share-types.rs b/crates/component-macro/tests/expanded/share-types.rs index 2e7bd33dfa35..7d3d2b33c093 100644 --- a/crates/component-macro/tests/expanded/share-types.rs +++ b/crates/component-macro/tests/expanded/share-types.rs @@ -186,7 +186,7 @@ pub mod foo { #[allow(clippy::all)] pub mod http_types { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -261,7 +261,7 @@ pub mod foo { #[allow(clippy::all)] pub mod http_fetch { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Request = super::foo::foo::http_types::Request; const _: () = { assert!(8 == < Request as wasmtime::component::ComponentType >::SIZE32); @@ -321,7 +321,7 @@ pub mod exports { #[allow(clippy::all)] pub mod http_handler { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Request = super::super::foo::foo::http_types::Request; const _: () = { assert!(8 == < Request as wasmtime::component::ComponentType >::SIZE32); diff --git a/crates/component-macro/tests/expanded/share-types_async.rs b/crates/component-macro/tests/expanded/share-types_async.rs index a622e2d7eb80..7b45f574c286 100644 --- a/crates/component-macro/tests/expanded/share-types_async.rs +++ b/crates/component-macro/tests/expanded/share-types_async.rs @@ -193,7 +193,7 @@ pub mod foo { #[allow(clippy::all)] pub mod http_types { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -274,7 +274,7 @@ pub mod foo { #[allow(clippy::all)] pub mod http_fetch { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Request = super::foo::foo::http_types::Request; const _: () = { assert!(8 == < Request as wasmtime::component::ComponentType >::SIZE32); @@ -342,7 +342,7 @@ pub mod exports { #[allow(clippy::all)] pub mod http_handler { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Request = super::super::foo::foo::http_types::Request; const _: () = { assert!(8 == < Request as wasmtime::component::ComponentType >::SIZE32); diff --git a/crates/component-macro/tests/expanded/share-types_tracing_async.rs b/crates/component-macro/tests/expanded/share-types_tracing_async.rs index 67c7eaf1646d..48faf1547355 100644 --- a/crates/component-macro/tests/expanded/share-types_tracing_async.rs +++ b/crates/component-macro/tests/expanded/share-types_tracing_async.rs @@ -193,7 +193,7 @@ pub mod foo { #[allow(clippy::all)] pub mod http_types { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -274,7 +274,7 @@ pub mod foo { #[allow(clippy::all)] pub mod http_fetch { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Request = super::foo::foo::http_types::Request; const _: () = { assert!(8 == < Request as wasmtime::component::ComponentType >::SIZE32); @@ -358,7 +358,7 @@ pub mod exports { #[allow(clippy::all)] pub mod http_handler { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Request = super::super::foo::foo::http_types::Request; const _: () = { assert!(8 == < Request as wasmtime::component::ComponentType >::SIZE32); diff --git a/crates/component-macro/tests/expanded/simple-functions.rs b/crates/component-macro/tests/expanded/simple-functions.rs index 16274afb8f98..9b4a809d9713 100644 --- a/crates/component-macro/tests/expanded/simple-functions.rs +++ b/crates/component-macro/tests/expanded/simple-functions.rs @@ -185,7 +185,7 @@ pub mod foo { #[allow(clippy::all)] pub mod simple { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub trait Host { fn f1(&mut self) -> (); fn f2(&mut self, a: u32) -> (); @@ -305,7 +305,7 @@ pub mod exports { #[allow(clippy::all)] pub mod simple { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { f1: wasmtime::component::Func, f2: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/simple-functions_async.rs b/crates/component-macro/tests/expanded/simple-functions_async.rs index eb10075d88c8..c2ba7839992b 100644 --- a/crates/component-macro/tests/expanded/simple-functions_async.rs +++ b/crates/component-macro/tests/expanded/simple-functions_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod simple { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { async fn f1(&mut self) -> (); @@ -330,7 +330,7 @@ pub mod exports { #[allow(clippy::all)] pub mod simple { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { f1: wasmtime::component::Func, f2: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/simple-functions_tracing_async.rs b/crates/component-macro/tests/expanded/simple-functions_tracing_async.rs index 16d28903eab0..5a61bdb1bbf5 100644 --- a/crates/component-macro/tests/expanded/simple-functions_tracing_async.rs +++ b/crates/component-macro/tests/expanded/simple-functions_tracing_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod simple { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { async fn f1(&mut self) -> (); @@ -418,7 +418,7 @@ pub mod exports { #[allow(clippy::all)] pub mod simple { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { f1: wasmtime::component::Func, f2: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/simple-lists.rs b/crates/component-macro/tests/expanded/simple-lists.rs index 0215d464ac38..ddd44d6cca17 100644 --- a/crates/component-macro/tests/expanded/simple-lists.rs +++ b/crates/component-macro/tests/expanded/simple-lists.rs @@ -187,7 +187,7 @@ pub mod foo { #[allow(clippy::all)] pub mod simple_lists { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub trait Host { fn simple_list1( &mut self, @@ -332,7 +332,7 @@ pub mod exports { #[allow(clippy::all)] pub mod simple_lists { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { simple_list1: wasmtime::component::Func, simple_list2: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/simple-lists_async.rs b/crates/component-macro/tests/expanded/simple-lists_async.rs index e04e3e3299ff..e764b1db483b 100644 --- a/crates/component-macro/tests/expanded/simple-lists_async.rs +++ b/crates/component-macro/tests/expanded/simple-lists_async.rs @@ -194,7 +194,7 @@ pub mod foo { #[allow(clippy::all)] pub mod simple_lists { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { async fn simple_list1( @@ -357,7 +357,7 @@ pub mod exports { #[allow(clippy::all)] pub mod simple_lists { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { simple_list1: wasmtime::component::Func, simple_list2: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/simple-lists_tracing_async.rs b/crates/component-macro/tests/expanded/simple-lists_tracing_async.rs index 69fd96ffeba3..77cd45e6ca89 100644 --- a/crates/component-macro/tests/expanded/simple-lists_tracing_async.rs +++ b/crates/component-macro/tests/expanded/simple-lists_tracing_async.rs @@ -194,7 +194,7 @@ pub mod foo { #[allow(clippy::all)] pub mod simple_lists { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { async fn simple_list1( @@ -418,7 +418,7 @@ pub mod exports { #[allow(clippy::all)] pub mod simple_lists { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { simple_list1: wasmtime::component::Func, simple_list2: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/simple-wasi.rs b/crates/component-macro/tests/expanded/simple-wasi.rs index 96d4a0bc2a94..2feddc5520e8 100644 --- a/crates/component-macro/tests/expanded/simple-wasi.rs +++ b/crates/component-macro/tests/expanded/simple-wasi.rs @@ -173,7 +173,7 @@ pub mod foo { #[allow(clippy::all)] pub mod wasi_filesystem { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -295,7 +295,7 @@ pub mod foo { #[allow(clippy::all)] pub mod wall_clock { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub trait Host {} pub trait GetHost< T, diff --git a/crates/component-macro/tests/expanded/simple-wasi_async.rs b/crates/component-macro/tests/expanded/simple-wasi_async.rs index 21f0e82575b3..e389ca9d5500 100644 --- a/crates/component-macro/tests/expanded/simple-wasi_async.rs +++ b/crates/component-macro/tests/expanded/simple-wasi_async.rs @@ -180,7 +180,7 @@ pub mod foo { #[allow(clippy::all)] pub mod wasi_filesystem { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -312,7 +312,7 @@ pub mod foo { #[allow(clippy::all)] pub mod wall_clock { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send {} pub trait GetHost< diff --git a/crates/component-macro/tests/expanded/simple-wasi_tracing_async.rs b/crates/component-macro/tests/expanded/simple-wasi_tracing_async.rs index 6c6a92ca2eb4..79a633b279a1 100644 --- a/crates/component-macro/tests/expanded/simple-wasi_tracing_async.rs +++ b/crates/component-macro/tests/expanded/simple-wasi_tracing_async.rs @@ -180,7 +180,7 @@ pub mod foo { #[allow(clippy::all)] pub mod wasi_filesystem { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -338,7 +338,7 @@ pub mod foo { #[allow(clippy::all)] pub mod wall_clock { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send {} pub trait GetHost< diff --git a/crates/component-macro/tests/expanded/small-anonymous.rs b/crates/component-macro/tests/expanded/small-anonymous.rs index baa6463b58e8..f14766767851 100644 --- a/crates/component-macro/tests/expanded/small-anonymous.rs +++ b/crates/component-macro/tests/expanded/small-anonymous.rs @@ -185,7 +185,7 @@ pub mod foo { #[allow(clippy::all)] pub mod anon { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -288,7 +288,7 @@ pub mod exports { #[allow(clippy::all)] pub mod anon { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/small-anonymous_async.rs b/crates/component-macro/tests/expanded/small-anonymous_async.rs index 94a45355742e..027581bbc954 100644 --- a/crates/component-macro/tests/expanded/small-anonymous_async.rs +++ b/crates/component-macro/tests/expanded/small-anonymous_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod anon { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -303,7 +303,7 @@ pub mod exports { #[allow(clippy::all)] pub mod anon { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/small-anonymous_tracing_async.rs b/crates/component-macro/tests/expanded/small-anonymous_tracing_async.rs index 113ccf2700ae..fbfc7b63f0a8 100644 --- a/crates/component-macro/tests/expanded/small-anonymous_tracing_async.rs +++ b/crates/component-macro/tests/expanded/small-anonymous_tracing_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod anon { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -316,7 +316,7 @@ pub mod exports { #[allow(clippy::all)] pub mod anon { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/smoke-export.rs b/crates/component-macro/tests/expanded/smoke-export.rs index 9a9f8a25b18e..498170dd624f 100644 --- a/crates/component-macro/tests/expanded/smoke-export.rs +++ b/crates/component-macro/tests/expanded/smoke-export.rs @@ -174,7 +174,7 @@ pub mod exports { #[allow(clippy::all)] pub mod the_name { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { y: wasmtime::component::Func, } diff --git a/crates/component-macro/tests/expanded/smoke-export_async.rs b/crates/component-macro/tests/expanded/smoke-export_async.rs index e21b8232c855..1fe656ec53d9 100644 --- a/crates/component-macro/tests/expanded/smoke-export_async.rs +++ b/crates/component-macro/tests/expanded/smoke-export_async.rs @@ -180,7 +180,7 @@ pub mod exports { #[allow(clippy::all)] pub mod the_name { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { y: wasmtime::component::Func, } diff --git a/crates/component-macro/tests/expanded/smoke-export_tracing_async.rs b/crates/component-macro/tests/expanded/smoke-export_tracing_async.rs index 9427cbcaa928..c4ef584cdc22 100644 --- a/crates/component-macro/tests/expanded/smoke-export_tracing_async.rs +++ b/crates/component-macro/tests/expanded/smoke-export_tracing_async.rs @@ -180,7 +180,7 @@ pub mod exports { #[allow(clippy::all)] pub mod the_name { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { y: wasmtime::component::Func, } diff --git a/crates/component-macro/tests/expanded/smoke.rs b/crates/component-macro/tests/expanded/smoke.rs index f455ece5d3f7..97e1b0fe51b6 100644 --- a/crates/component-macro/tests/expanded/smoke.rs +++ b/crates/component-macro/tests/expanded/smoke.rs @@ -170,7 +170,7 @@ const _: () = { #[allow(clippy::all)] pub mod imports { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub trait Host { fn y(&mut self) -> (); } diff --git a/crates/component-macro/tests/expanded/smoke_async.rs b/crates/component-macro/tests/expanded/smoke_async.rs index bfc70a8646fb..85b47c291d32 100644 --- a/crates/component-macro/tests/expanded/smoke_async.rs +++ b/crates/component-macro/tests/expanded/smoke_async.rs @@ -177,7 +177,7 @@ const _: () = { #[allow(clippy::all)] pub mod imports { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { async fn y(&mut self) -> (); diff --git a/crates/component-macro/tests/expanded/smoke_tracing_async.rs b/crates/component-macro/tests/expanded/smoke_tracing_async.rs index a3cd2582d13a..fc43e9435f0f 100644 --- a/crates/component-macro/tests/expanded/smoke_tracing_async.rs +++ b/crates/component-macro/tests/expanded/smoke_tracing_async.rs @@ -177,7 +177,7 @@ const _: () = { #[allow(clippy::all)] pub mod imports { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { async fn y(&mut self) -> (); diff --git a/crates/component-macro/tests/expanded/strings.rs b/crates/component-macro/tests/expanded/strings.rs index 743d69f5044c..40b22082c941 100644 --- a/crates/component-macro/tests/expanded/strings.rs +++ b/crates/component-macro/tests/expanded/strings.rs @@ -185,7 +185,7 @@ pub mod foo { #[allow(clippy::all)] pub mod strings { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub trait Host { fn a(&mut self, x: wasmtime::component::__internal::String) -> (); fn b(&mut self) -> wasmtime::component::__internal::String; @@ -283,7 +283,7 @@ pub mod exports { #[allow(clippy::all)] pub mod strings { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { a: wasmtime::component::Func, b: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/strings_async.rs b/crates/component-macro/tests/expanded/strings_async.rs index a597bb7f52ac..303e9729bf9a 100644 --- a/crates/component-macro/tests/expanded/strings_async.rs +++ b/crates/component-macro/tests/expanded/strings_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod strings { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { async fn a(&mut self, x: wasmtime::component::__internal::String) -> (); @@ -302,7 +302,7 @@ pub mod exports { #[allow(clippy::all)] pub mod strings { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { a: wasmtime::component::Func, b: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/strings_tracing_async.rs b/crates/component-macro/tests/expanded/strings_tracing_async.rs index c7d2ae7f767f..924194733ab6 100644 --- a/crates/component-macro/tests/expanded/strings_tracing_async.rs +++ b/crates/component-macro/tests/expanded/strings_tracing_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod strings { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[wasmtime::component::__internal::async_trait] pub trait Host: Send { async fn a(&mut self, x: wasmtime::component::__internal::String) -> (); @@ -347,7 +347,7 @@ pub mod exports { #[allow(clippy::all)] pub mod strings { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub struct Guest { a: wasmtime::component::Func, b: wasmtime::component::Func, diff --git a/crates/component-macro/tests/expanded/unstable-features.rs b/crates/component-macro/tests/expanded/unstable-features.rs index c252a541394d..9ac28a24a454 100644 --- a/crates/component-macro/tests/expanded/unstable-features.rs +++ b/crates/component-macro/tests/expanded/unstable-features.rs @@ -343,7 +343,7 @@ pub mod foo { #[allow(clippy::all)] pub mod the_interface { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; /// Link-time configurations. #[derive(Clone, Debug, Default)] pub struct LinkOptions { diff --git a/crates/component-macro/tests/expanded/unstable-features_async.rs b/crates/component-macro/tests/expanded/unstable-features_async.rs index 1b0da66840b2..c528914ebb6f 100644 --- a/crates/component-macro/tests/expanded/unstable-features_async.rs +++ b/crates/component-macro/tests/expanded/unstable-features_async.rs @@ -300,7 +300,7 @@ const _: () = { "baz", wasmtime::component::ResourceType::host::(), move |mut store, rep| { - std::boxed::Box::new(async move { + wasmtime::component::__internal::Box::new(async move { HostBaz::drop( &mut host_getter(store.data_mut()), wasmtime::component::Resource::new_own(rep), @@ -370,7 +370,7 @@ pub mod foo { #[allow(clippy::all)] pub mod the_interface { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; /// Link-time configurations. #[derive(Clone, Debug, Default)] pub struct LinkOptions { @@ -465,7 +465,7 @@ pub mod foo { "bar", wasmtime::component::ResourceType::host::(), move |mut store, rep| { - std::boxed::Box::new(async move { + wasmtime::component::__internal::Box::new(async move { HostBar::drop( &mut host_getter(store.data_mut()), wasmtime::component::Resource::new_own(rep), diff --git a/crates/component-macro/tests/expanded/unstable-features_tracing_async.rs b/crates/component-macro/tests/expanded/unstable-features_tracing_async.rs index d718adca7140..8164a2906b46 100644 --- a/crates/component-macro/tests/expanded/unstable-features_tracing_async.rs +++ b/crates/component-macro/tests/expanded/unstable-features_tracing_async.rs @@ -300,7 +300,7 @@ const _: () = { "baz", wasmtime::component::ResourceType::host::(), move |mut store, rep| { - std::boxed::Box::new(async move { + wasmtime::component::__internal::Box::new(async move { HostBaz::drop( &mut host_getter(store.data_mut()), wasmtime::component::Resource::new_own(rep), @@ -399,7 +399,7 @@ pub mod foo { #[allow(clippy::all)] pub mod the_interface { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; /// Link-time configurations. #[derive(Clone, Debug, Default)] pub struct LinkOptions { @@ -494,7 +494,7 @@ pub mod foo { "bar", wasmtime::component::ResourceType::host::(), move |mut store, rep| { - std::boxed::Box::new(async move { + wasmtime::component::__internal::Box::new(async move { HostBar::drop( &mut host_getter(store.data_mut()), wasmtime::component::Resource::new_own(rep), diff --git a/crates/component-macro/tests/expanded/unversioned-foo.rs b/crates/component-macro/tests/expanded/unversioned-foo.rs index 20b394cf1bfb..bec71942c97c 100644 --- a/crates/component-macro/tests/expanded/unversioned-foo.rs +++ b/crates/component-macro/tests/expanded/unversioned-foo.rs @@ -172,7 +172,7 @@ pub mod foo { #[allow(clippy::all)] pub mod a { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/unversioned-foo_async.rs b/crates/component-macro/tests/expanded/unversioned-foo_async.rs index fc83094285b6..47b98b1c79fe 100644 --- a/crates/component-macro/tests/expanded/unversioned-foo_async.rs +++ b/crates/component-macro/tests/expanded/unversioned-foo_async.rs @@ -179,7 +179,7 @@ pub mod foo { #[allow(clippy::all)] pub mod a { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/unversioned-foo_tracing_async.rs b/crates/component-macro/tests/expanded/unversioned-foo_tracing_async.rs index 062ca5b258f7..2dfef8c54f1e 100644 --- a/crates/component-macro/tests/expanded/unversioned-foo_tracing_async.rs +++ b/crates/component-macro/tests/expanded/unversioned-foo_tracing_async.rs @@ -179,7 +179,7 @@ pub mod foo { #[allow(clippy::all)] pub mod a { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/use-paths.rs b/crates/component-macro/tests/expanded/use-paths.rs index 42e5e053aebc..10b39e821120 100644 --- a/crates/component-macro/tests/expanded/use-paths.rs +++ b/crates/component-macro/tests/expanded/use-paths.rs @@ -175,7 +175,7 @@ pub mod foo { #[allow(clippy::all)] pub mod a { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -239,7 +239,7 @@ pub mod foo { #[allow(clippy::all)] pub mod b { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Foo = super::super::super::foo::foo::a::Foo; const _: () = { assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32); @@ -293,7 +293,7 @@ pub mod foo { #[allow(clippy::all)] pub mod c { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Foo = super::super::super::foo::foo::b::Foo; const _: () = { assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32); @@ -349,7 +349,7 @@ pub mod foo { #[allow(clippy::all)] pub mod d { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Foo = super::foo::foo::c::Foo; const _: () = { assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32); diff --git a/crates/component-macro/tests/expanded/use-paths_async.rs b/crates/component-macro/tests/expanded/use-paths_async.rs index 0aaae7b509aa..02c29b6e0aa2 100644 --- a/crates/component-macro/tests/expanded/use-paths_async.rs +++ b/crates/component-macro/tests/expanded/use-paths_async.rs @@ -183,7 +183,7 @@ pub mod foo { #[allow(clippy::all)] pub mod a { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -255,7 +255,7 @@ pub mod foo { #[allow(clippy::all)] pub mod b { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Foo = super::super::super::foo::foo::a::Foo; const _: () = { assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32); @@ -317,7 +317,7 @@ pub mod foo { #[allow(clippy::all)] pub mod c { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Foo = super::super::super::foo::foo::b::Foo; const _: () = { assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32); @@ -381,7 +381,7 @@ pub mod foo { #[allow(clippy::all)] pub mod d { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Foo = super::foo::foo::c::Foo; const _: () = { assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32); diff --git a/crates/component-macro/tests/expanded/use-paths_tracing_async.rs b/crates/component-macro/tests/expanded/use-paths_tracing_async.rs index 3affa9c4cbf7..4732d2db3395 100644 --- a/crates/component-macro/tests/expanded/use-paths_tracing_async.rs +++ b/crates/component-macro/tests/expanded/use-paths_tracing_async.rs @@ -183,7 +183,7 @@ pub mod foo { #[allow(clippy::all)] pub mod a { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -268,7 +268,7 @@ pub mod foo { #[allow(clippy::all)] pub mod b { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Foo = super::super::super::foo::foo::a::Foo; const _: () = { assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32); @@ -343,7 +343,7 @@ pub mod foo { #[allow(clippy::all)] pub mod c { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Foo = super::super::super::foo::foo::b::Foo; const _: () = { assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32); @@ -420,7 +420,7 @@ pub mod foo { #[allow(clippy::all)] pub mod d { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type Foo = super::foo::foo::c::Foo; const _: () = { assert!(0 == < Foo as wasmtime::component::ComponentType >::SIZE32); diff --git a/crates/component-macro/tests/expanded/variants.rs b/crates/component-macro/tests/expanded/variants.rs index 3e67dc0d976d..86e8d659eae5 100644 --- a/crates/component-macro/tests/expanded/variants.rs +++ b/crates/component-macro/tests/expanded/variants.rs @@ -185,7 +185,7 @@ pub mod foo { #[allow(clippy::all)] pub mod variants { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -928,7 +928,7 @@ pub mod exports { #[allow(clippy::all)] pub mod variants { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/variants_async.rs b/crates/component-macro/tests/expanded/variants_async.rs index 36cf76daa580..051f71521337 100644 --- a/crates/component-macro/tests/expanded/variants_async.rs +++ b/crates/component-macro/tests/expanded/variants_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod variants { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -988,7 +988,7 @@ pub mod exports { #[allow(clippy::all)] pub mod variants { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/variants_tracing_async.rs b/crates/component-macro/tests/expanded/variants_tracing_async.rs index 792fd5815987..6692b92bb05f 100644 --- a/crates/component-macro/tests/expanded/variants_tracing_async.rs +++ b/crates/component-macro/tests/expanded/variants_tracing_async.rs @@ -192,7 +192,7 @@ pub mod foo { #[allow(clippy::all)] pub mod variants { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] @@ -1312,7 +1312,7 @@ pub mod exports { #[allow(clippy::all)] pub mod variants { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; #[derive(wasmtime::component::ComponentType)] #[derive(wasmtime::component::Lift)] #[derive(wasmtime::component::Lower)] diff --git a/crates/component-macro/tests/expanded/wat.rs b/crates/component-macro/tests/expanded/wat.rs index 14da6ff9efb6..de05578b9da7 100644 --- a/crates/component-macro/tests/expanded/wat.rs +++ b/crates/component-macro/tests/expanded/wat.rs @@ -180,7 +180,7 @@ pub mod exports { #[allow(clippy::all)] pub mod this_name_is_duplicated { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type ThisNameIsDuplicated = wasmtime::component::ResourceAny; pub struct GuestThisNameIsDuplicated<'a> { funcs: &'a Guest, diff --git a/crates/component-macro/tests/expanded/wat_async.rs b/crates/component-macro/tests/expanded/wat_async.rs index cad73611fe21..17864d24d90c 100644 --- a/crates/component-macro/tests/expanded/wat_async.rs +++ b/crates/component-macro/tests/expanded/wat_async.rs @@ -186,7 +186,7 @@ pub mod exports { #[allow(clippy::all)] pub mod this_name_is_duplicated { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type ThisNameIsDuplicated = wasmtime::component::ResourceAny; pub struct GuestThisNameIsDuplicated<'a> { funcs: &'a Guest, diff --git a/crates/component-macro/tests/expanded/wat_tracing_async.rs b/crates/component-macro/tests/expanded/wat_tracing_async.rs index cad73611fe21..17864d24d90c 100644 --- a/crates/component-macro/tests/expanded/wat_tracing_async.rs +++ b/crates/component-macro/tests/expanded/wat_tracing_async.rs @@ -186,7 +186,7 @@ pub mod exports { #[allow(clippy::all)] pub mod this_name_is_duplicated { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type ThisNameIsDuplicated = wasmtime::component::ResourceAny; pub struct GuestThisNameIsDuplicated<'a> { funcs: &'a Guest, diff --git a/crates/component-macro/tests/expanded/worlds-with-types.rs b/crates/component-macro/tests/expanded/worlds-with-types.rs index 2fd790395a13..216976fd4272 100644 --- a/crates/component-macro/tests/expanded/worlds-with-types.rs +++ b/crates/component-macro/tests/expanded/worlds-with-types.rs @@ -222,7 +222,7 @@ pub mod foo { #[allow(clippy::all)] pub mod i { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type T = u16; const _: () = { assert!(2 == < T as wasmtime::component::ComponentType >::SIZE32); diff --git a/crates/component-macro/tests/expanded/worlds-with-types_async.rs b/crates/component-macro/tests/expanded/worlds-with-types_async.rs index 48f42f3a99b6..3eb69477c09f 100644 --- a/crates/component-macro/tests/expanded/worlds-with-types_async.rs +++ b/crates/component-macro/tests/expanded/worlds-with-types_async.rs @@ -232,7 +232,7 @@ pub mod foo { #[allow(clippy::all)] pub mod i { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type T = u16; const _: () = { assert!(2 == < T as wasmtime::component::ComponentType >::SIZE32); 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.rs index 63ed3ffff6e4..17662882ff17 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 @@ -240,7 +240,7 @@ pub mod foo { #[allow(clippy::all)] pub mod i { #[allow(unused_imports)] - use wasmtime::component::__internal::anyhow; + use wasmtime::component::__internal::{anyhow, Box}; pub type T = u16; const _: () = { assert!(2 == < T as wasmtime::component::ComponentType >::SIZE32); From 70625ba117400428812dcc51e8704ff08c31b572 Mon Sep 17 00:00:00 2001 From: "maple@max" Date: Sat, 21 Dec 2024 02:01:19 +0800 Subject: [PATCH 4/4] remove async_trait --- crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs b/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs index c1f110ea2c9c..c8a756cd3de8 100644 --- a/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs +++ b/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs @@ -490,14 +490,12 @@ pub mod _6_exported_resources; /// Example of generating **async** bindings for imported resources in a world. /// /// Notable differences from [`_4_imported_resources`] are: -/// * [`async_trait`] is used. /// * async functions are used /// * enabled async in bindgen! macro /// /// See [wasi_async_example](https://github.com/bytecodealliance/wasmtime/tree/main/examples/wasi-async) for async function calls on a host. /// /// ```rust -/// use async_trait::async_trait; /// use wasmtime::Result; /// use wasmtime::component::{bindgen, ResourceTable, Resource}; /// use example::imported_resources::logging::{Level, Host, HostLogger}; @@ -516,7 +514,6 @@ pub mod _6_exported_resources; /// /// // This separate `HostLogger` trait serves to act as a namespace for just /// // the `logger`-related resource methods. -/// #[async_trait] /// impl HostLogger for MyState { /// // A `constructor` in WIT maps to a `new` function in Rust. /// async fn new(&mut self, max_level: Level) -> Result> {