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 dcd1653efacf..730c6acb3213 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::trait_variant_make(::core::marker::Send)] pub trait Host: Send { /// A function that accepts a character @@ -274,7 +274,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 aace81d094b6..aa1f926ea35f 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::trait_variant_make(::core::marker::Send)] pub trait Host: Send { /// A function that accepts a character @@ -303,7 +303,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 83ed6298a13e..dfda26d25938 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)] @@ -456,7 +456,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 3fb77150623f..d949eaae9fa2 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)] @@ -616,7 +616,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 59a4a1a91fcf..7ba8b30a3908 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)] @@ -257,7 +257,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::trait_variant_make(::core::marker::Send)] 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 5754b8c1371c..b394499697c0 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)] @@ -270,7 +270,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::trait_variant_make(::core::marker::Send)] 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 b29ad900f969..c872a542d0ce 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); @@ -472,7 +472,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 30fb04df8e5c..01bfeb05ab6d 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); @@ -584,7 +584,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 a489394754c4..4313d8ca2b95 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::trait_variant_make(::core::marker::Send)] pub trait Host: Send { async fn f32_param(&mut self, x: f32) -> (); @@ -295,7 +295,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 f711cafffa7a..25194e376795 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::trait_variant_make(::core::marker::Send)] pub trait Host: Send { async fn f32_param(&mut self, x: f32) -> (); @@ -353,7 +353,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 414c50dff3db..47045b1f6a92 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::trait_variant_make(::core::marker::Send)] pub trait Host: Send { async fn a1(&mut self, x: u8) -> (); @@ -534,7 +534,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 abda88c6fb1c..a8778d525cb6 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::trait_variant_make(::core::marker::Send)] pub trait Host: Send { async fn a1(&mut self, x: u8) -> (); @@ -799,7 +799,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 c9683965cb71..aa55a3f6503e 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)] @@ -1073,7 +1073,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 b74add62591d..a1e470bea83f 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)] @@ -1504,7 +1504,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 0c5143a8a3a7..1f454d623998 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)] @@ -462,7 +462,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 6bfcba0c10bf..334616870f8a 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)] @@ -505,7 +505,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 4483a732f68d..2b434520c89c 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::trait_variant_make(::core::marker::Send)] pub trait Host: Send { async fn mra(&mut self) -> (); @@ -311,7 +311,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 25c65f1be60a..ca9c503e58b7 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::trait_variant_make(::core::marker::Send)] pub trait Host: Send { async fn mra(&mut self) -> (); @@ -376,7 +376,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 43fc69677ce3..885c0ce1b69b 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::trait_variant_make(::core::marker::Send)] pub trait Host: Send { async fn x(&mut self) -> (); @@ -268,7 +268,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::trait_variant_make(::core::marker::Send)] pub trait Host: Send { async fn x(&mut self) -> (); @@ -329,7 +329,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, } @@ -432,7 +432,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 c5e6c45376f2..76256e2fa92b 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::trait_variant_make(::core::marker::Send)] pub trait Host: Send { async fn x(&mut self) -> (); @@ -281,7 +281,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::trait_variant_make(::core::marker::Send)] pub trait Host: Send { async fn x(&mut self) -> (); @@ -355,7 +355,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, } @@ -469,7 +469,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 80106c574dc1..d4b1af2dee6d 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::trait_variant_make(::core::marker::Send)] 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 80106c574dc1..d4b1af2dee6d 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::trait_variant_make(::core::marker::Send)] 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 1eae1817d355..45fdb5d811b5 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::trait_variant_make(::core::marker::Send)] 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 1eae1817d355..45fdb5d811b5 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::trait_variant_make(::core::marker::Send)] 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 2760af0cf0b4..0c087de7ff66 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)] @@ -557,7 +557,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 410c1628fa34..075b7dc57ae1 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)] @@ -718,7 +718,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 72613090032a..467bb6509fb6 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); @@ -225,7 +225,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 d44efbea7e8f..2adc67f4420c 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); @@ -225,7 +225,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 b5b3978dbb5e..9a37b5488e67 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::trait_variant_make(::core::marker::Send)] pub trait HostY { @@ -297,7 +297,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), @@ -328,7 +328,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, @@ -508,7 +508,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> { @@ -697,7 +697,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, @@ -814,7 +814,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 219148f3870e..7cf0ade0f577 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::trait_variant_make(::core::marker::Send)] pub trait HostY { @@ -297,7 +297,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), @@ -328,7 +328,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, @@ -535,7 +535,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> { @@ -753,7 +753,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, @@ -879,7 +879,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 ec3f1308dd59..99899d3254fc 100644 --- a/crates/component-macro/tests/expanded/resources-import_async.rs +++ b/crates/component-macro/tests/expanded/resources-import_async.rs @@ -263,7 +263,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), @@ -371,7 +371,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::trait_variant_make(::core::marker::Send)] pub trait HostBar { @@ -551,7 +551,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), @@ -953,7 +953,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::trait_variant_make(::core::marker::Send)] pub trait HostA { @@ -996,7 +996,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), @@ -1022,7 +1022,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::trait_variant_make(::core::marker::Send)] pub trait Host: Send {} @@ -1063,7 +1063,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::trait_variant_make(::core::marker::Send)] pub trait Host: Send {} @@ -1104,7 +1104,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::trait_variant_make(::core::marker::Send)] pub trait Host: Send { @@ -1161,7 +1161,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::trait_variant_make(::core::marker::Send)] pub trait HostFoo { @@ -1205,7 +1205,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), @@ -1236,7 +1236,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 51080a17dc50..5332127243bc 100644 --- a/crates/component-macro/tests/expanded/resources-import_tracing_async.rs +++ b/crates/component-macro/tests/expanded/resources-import_tracing_async.rs @@ -263,7 +263,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), @@ -434,7 +434,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::trait_variant_make(::core::marker::Send)] pub trait HostBar { @@ -614,7 +614,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), @@ -1344,7 +1344,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::trait_variant_make(::core::marker::Send)] pub trait HostA { @@ -1387,7 +1387,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), @@ -1413,7 +1413,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::trait_variant_make(::core::marker::Send)] pub trait Host: Send {} @@ -1454,7 +1454,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::trait_variant_make(::core::marker::Send)] pub trait Host: Send {} @@ -1495,7 +1495,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::trait_variant_make(::core::marker::Send)] pub trait Host: Send { @@ -1565,7 +1565,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::trait_variant_make(::core::marker::Send)] pub trait HostFoo { @@ -1609,7 +1609,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), @@ -1640,7 +1640,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 d4ae2459ad93..b6f3d4e9b6b5 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)] @@ -273,7 +273,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); @@ -340,7 +340,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 a6301a0bc381..be08b82994fa 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)] @@ -273,7 +273,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); @@ -356,7 +356,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 37ac5a0edb0a..8f564e80ae1d 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::trait_variant_make(::core::marker::Send)] pub trait Host: Send { async fn f1(&mut self) -> (); @@ -329,7 +329,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 2b7bc0d8e575..d9771b87beae 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::trait_variant_make(::core::marker::Send)] pub trait Host: Send { async fn f1(&mut self) -> (); @@ -417,7 +417,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 a2d87ff226d0..d1ddd48e69dd 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::trait_variant_make(::core::marker::Send)] pub trait Host: Send { async fn simple_list1( @@ -356,7 +356,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 2b654ca9410c..5170ff1563d6 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::trait_variant_make(::core::marker::Send)] pub trait Host: Send { async fn simple_list1( @@ -417,7 +417,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 a3c30802728d..5b95ff182556 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)] @@ -311,7 +311,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::trait_variant_make(::core::marker::Send)] 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 92aa99a0ca4b..17b68e5c2c0e 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)] @@ -337,7 +337,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::trait_variant_make(::core::marker::Send)] 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 bdf7af84c093..239bca6be1e2 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)] @@ -302,7 +302,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 4d3526379cb9..1226081d5fad 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)] @@ -315,7 +315,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 fb7bc94f54f6..441d2f7eb40a 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::trait_variant_make(::core::marker::Send)] 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 038df8017ab0..02b979f4a7bb 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::trait_variant_make(::core::marker::Send)] 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 b598be395c92..4d448ab0a345 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::trait_variant_make(::core::marker::Send)] pub trait Host: Send { async fn a(&mut self, x: wasmtime::component::__internal::String) -> (); @@ -301,7 +301,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 deb2db8761ed..6e19b15240a3 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::trait_variant_make(::core::marker::Send)] pub trait Host: Send { async fn a(&mut self, x: wasmtime::component::__internal::String) -> (); @@ -346,7 +346,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 3580c845da5e..23686a38346e 100644 --- a/crates/component-macro/tests/expanded/unstable-features_async.rs +++ b/crates/component-macro/tests/expanded/unstable-features_async.rs @@ -298,7 +298,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), @@ -368,7 +368,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 { @@ -462,7 +462,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 676c088e0589..500bc93d285b 100644 --- a/crates/component-macro/tests/expanded/unstable-features_tracing_async.rs +++ b/crates/component-macro/tests/expanded/unstable-features_tracing_async.rs @@ -298,7 +298,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), @@ -397,7 +397,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 { @@ -491,7 +491,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 7f3947b8a439..c7c5c8d9d53a 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 5775c1d239c1..489b1855dd81 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 256e28bb4c2f..43033c158764 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)] @@ -254,7 +254,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); @@ -315,7 +315,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); @@ -378,7 +378,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 c9dd4cd453c5..6f5f5a69608c 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)] @@ -267,7 +267,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); @@ -341,7 +341,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); @@ -417,7 +417,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 371dc5cb517c..bf9403156018 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)] @@ -987,7 +987,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 8f29d6b7884e..089de949b552 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)] @@ -1311,7 +1311,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 ec1384650f3c..c5c1b0f3f6c0 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 6c8e7b8d36ef..6970a67b8721 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); 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..c8a756cd3de8 100644 --- a/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs +++ b/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs @@ -486,3 +486,72 @@ 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 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 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. +/// 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; diff --git a/crates/wit-bindgen/src/lib.rs b/crates/wit-bindgen/src/lib.rs index 254a9aa7e79d..6fd73b7efc4f 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 }}) }},